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
The default host in the start script is 0.0.0.0. This differs from the default of webpack-dev-server which is to bind to localhost.
I found this out by reading the output of npm run dev:
You can now view app in the browser.
Local: http://localhost:3001/
On Your Network: http://192.168.43.210:3001/
Note that the development build is not optimized.
To create a production build, use yarn build.
I hadn't noticed it much before, but I happened to be in a coffee shop working on an API client, so I found it a bit concerning that it was being exposed to the outside. The use case given is for Tools like cloud9. I suggest having them alter their package.json to "start": "HOST=0.0.0.0 react-scripts start" or something instead of having the unusual use case made the default.
If nothing else, if the default can be changed, the message shown when running npm run dev can be simplified. If you have the typical use case of using it for dev only on your machine it's unnecessary, and if you're using ngrok it's a bit redundant.
The text was updated successfully, but these errors were encountered:
There are other projects that carefully set it to localhost/127.0.0.1 in development mode: sinatra/sinatra#634 One difference is that create-react-app is frontend, except when it has a proxy (which I've done before).
Hey Guys, not sure if it is related but I'll follow up this thread maybe it can be closed already right?
Recently I switched my workflow from a Macos to Windows 10 pro, I was used to test my project on multiple devices using the same wi-fi network and my local IP lets say 192.168.15.12:3001
O Windows it doenst seem to work out of the box, not sure if I'm missing some firewall config... do you have it documented somewhre?
The default host in the start script is
0.0.0.0
. This differs from the default of webpack-dev-server which is to bind to localhost.I found this out by reading the output of
npm run dev
:I hadn't noticed it much before, but I happened to be in a coffee shop working on an API client, so I found it a bit concerning that it was being exposed to the outside. The use case given is for Tools like cloud9. I suggest having them alter their
package.json
to"start": "HOST=0.0.0.0 react-scripts start"
or something instead of having the unusual use case made the default.If nothing else, if the default can be changed, the message shown when running
npm run dev
can be simplified. If you have the typical use case of using it for dev only on your machine it's unnecessary, and if you're using ngrok it's a bit redundant.The text was updated successfully, but these errors were encountered: