Skip to content

Commit 3fe572a

Browse files
adamnovakolivewong
andauthored
Handle new http-proxy-middleware version (#154)
* Handle new http-proxy-middleware version This changes the proxy setup code to work right with the http-proxy-middleware that exports multiple functions. It also makes sure to stop the process if proxy setup fails, because react-scripts will claim to successfully start the server but not actually open the port, if proxy setup throws. * Updated README - port forward to 3001 not 3000 * Use an environment variable to override server port 3000 in .env * Keep allowing config.serverPort to work Co-authored-by: Olivia Wong <[email protected]>
1 parent b362d41 commit 3fe572a

File tree

6 files changed

+73
-15921
lines changed

6 files changed

+73
-15921
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
node_modules
2+
.env
3+
.config/
24
.tmp
35
.DS_store
46
.publish
57
.vscode
68
.idea
79
build/
810
*.swp
9-
*~
11+
*~

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ PATH=/<your_path_to_vg>:$PATH
9393
```
9494
npm run serve
9595
```
96-
- If the node server is running on your local machine, open a browser tab and go to `localhost:3000`.
97-
- If the node server is running on a different machine, open a local browser tab and go to the server's URL on port 3000 `http://<your server's IP or URL>:3000/`.
98-
If you cannot access the server's port 3000 from the browser, instead of configuring firewall rules etc., it's probably easiest to set up an SSH tunnel.
96+
- If the node server is running on your local machine, open a browser tab and go to `localhost:3001`.
97+
- If the node server is running on a different machine, open a local browser tab and go to the server's URL on port 3001 `http://<your server's IP or URL>:3001/`.
98+
If you cannot access the server's port 3001 from the browser, instead of configuring firewall rules etc., it's probably easiest to set up an SSH tunnel.
9999

100100
```
101-
ssh -N -L 3000:localhost:3000 <your username>@<your server>
101+
ssh -N -L 3001:localhost:3001 <your username>@<your server>
102102
```
103103

104104
#### Adding Your Own Data
@@ -153,7 +153,7 @@ The `build`/`serve` pipeline can only produce minified code, which can be diffic
153153
```
154154
npm run start
155155
```
156-
This will use React's development mode server to serve the frontend, and run the backend in a separate process, behind React's proxy. Local ports 3000 and 3001 must both be free.
156+
This will use React's development mode server to serve the frontend, and run the backend in a separate process, behind React's proxy. Local ports 3000 (or set a different SERVER_PORT in .env) and 3001 must both be free.
157157

158158
Running in this mode allows the application to produce human-readable stack traces when something goes wrong in the browser.
159159

0 commit comments

Comments
 (0)