You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
react-scripts@0.2.x honors process.env.PORT when you run npm start.
For some reason it gets set to 5000 (is Foreman doing it?)
However the CORS headers are enabled for 3000.
So you’d either need to change npm start to PORT=3000 npm start (not cross-platform btw), or make it cross-env PORT=3000 npm start (cross-platform but needs cross-env dependency), or somehow configure Foreman to ask it to be on 3000, or just set CORS headers to use 5000.
The text was updated successfully, but these errors were encountered:
Digging in, Foreman is indeed setting process.env.PORT to 5000 by default. We can pass a -p flag to Foreman to specify 3000.
Under the hood, both cross-env and foreman eventually use Node's child_process to spawn the process, so it should be cross env but I'll commandeer a Windows machine and verify.
We could get fancier, but I'm going to wait for the dust around the proxy idea to settle.
react-scripts@0.2.x
honorsprocess.env.PORT
when you runnpm start
.For some reason it gets set to
5000
(is Foreman doing it?)However the CORS headers are enabled for
3000
.So you’d either need to change
npm start
toPORT=3000 npm start
(not cross-platform btw), or make itcross-env PORT=3000 npm start
(cross-platform but needscross-env
dependency), or somehow configure Foreman to ask it to be on3000
, or just set CORS headers to use5000
.The text was updated successfully, but these errors were encountered: