diff --git a/examples/react-website/README.md b/examples/react-website/README.md index d12a8c1..60f2930 100644 --- a/examples/react-website/README.md +++ b/examples/react-website/README.md @@ -6,7 +6,7 @@ Notice that `./website` is a basic react website, the only file we changed is `/ ## Dev mode -`wing run examples/react-website/main.w` +`wing run examples/react-website/wing/main.w` The command above will open both the simulator and react dev app on the browser. @@ -14,7 +14,7 @@ Try to make some changes to the wing file and watch the react file changes! ## Run on simulator when react is in dev mode -`wing test examples/react-website/main.w` +`wing test examples/react-website/wing/main.w` Done developing, let's build the website, still on the simulator: @@ -22,19 +22,19 @@ Done developing, let's build the website, still on the simulator: 1. Add `useBuildCommand: true` to line 18 2. run: -`wing run examples/react-website/main.w` +`wing run examples/react-website/wing/main.w` ## Build on tf-aws Now, let's test it on tf-aws platform: -`wing test -t tf-aws examples/react-website/main.w` +`wing test -t tf-aws examples/react-website/wing/main.w` Great! Everything is working, now let's deploy to AWS: -`wing compile -t tf-aws examples/react-website/main.w` +`wing compile -t tf-aws examples/react-website/wing/main.w` -then go to the `examples/react-website/target/main.tfaws` folder, and run: +then go to the `examples/react-website/wing/target/main.tfaws` folder, and run: `terraform init` and diff --git a/examples/react-website/website/.gitignore b/examples/react-website/website/.gitignore index 448863b..3ee9e28 100644 --- a/examples/react-website/website/.gitignore +++ b/examples/react-website/website/.gitignore @@ -22,3 +22,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* +# wing autogenerated files +/public/wing.js +/public/wing.json \ No newline at end of file diff --git a/examples/react-website/website/public/wing.js b/examples/react-website/website/public/wing.js deleted file mode 100644 index ae14f23..0000000 --- a/examples/react-website/website/public/wing.js +++ /dev/null @@ -1,5 +0,0 @@ -// This file is generated by wing -window.wingEnv = { - "REACT_APP_SERVER_URL": "http://127.0.0.1:49946", - "G": "123" -}; \ No newline at end of file diff --git a/examples/react-website/website/public/wing.json b/examples/react-website/website/public/wing.json deleted file mode 100644 index 1d21828..0000000 --- a/examples/react-website/website/public/wing.json +++ /dev/null @@ -1 +0,0 @@ -{"REACT_APP_SERVER_URL": "http://127.0.0.1:50131", "G": "1", "ANOTHER_ONE": "1"} diff --git a/examples/react-website/main.w b/examples/react-website/wing/main.w similarity index 95% rename from examples/react-website/main.w rename to examples/react-website/wing/main.w index 2336352..a8a0228 100644 --- a/examples/react-website/main.w +++ b/examples/react-website/wing/main.w @@ -13,7 +13,7 @@ return cloud.ApiResponse { }); let website = new ex.ReactApp( - projectPath: "./website", + projectPath: "../website", localPort: 3002, );