-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Default port is conflicting with node/rails backend #52
Comments
We can add .env file for port (https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-development-environment-variables-in-env) or we can change package.json's start script (not sure if its cross platform): some discussion is here: facebook/create-react-app#1083 IMHO, .env way is better. |
Most of the frontend and backend here work on the default port to keep things simple for beginners. You have a valid point though. Trying to run the rails or node backend with this would definitely cause port conflicts. Using cross-env could be a good idea. Shipping with a default port and providing instructions to change the port in the readme would be a great addition. |
I m totally for begginer's simplicity of starting playing with stuff. But as for now you can not run this project in default configuration from repo : you should change port. Changing port for CreateReactApp-based project is not transparent - you should do some googling.
But i m sure we should do something - 1) or 2) update: React have .env file gitignored and we can not add this to repo to prevent port conflict in default installation. So, if we want to go first way, user should do it manually. Way 2 have one more dev-dependency, but works cross-platform and tested ok. Here is PR for fix: #56 |
Default port for React app is conflicting with Node's default port 3000. It will be better to change it, because for Rails app 3000 is also default port.
Just look at angular projects with 4000+ port range.
The text was updated successfully, but these errors were encountered: