Search code examples
javascriptnode.jsreactjsdeploymentreact-boilerplate

React-Boilerplate run production without port


Well, I want to deploy the react-boilerplate project to my digital ocean vps server. Command npm run start:production runs the application by address http://XXX.XXX.XXX.XXX:3000/.

I'm going to run the server without port like http://XXX.XXX.XXX.XXX or http://my-domain.com.

How can I set port or domain for production mode?


Solution

  • Generally you will run your node app on localhost at port 3000. Then you would use nginx as a proxy to receive connections on port 80/443 and forward them to your server running on port 3000. Here are some notes that describe some of the configuration needed for this:

    https://github.com/jensen/deployment-notes#nginx