Deploy create-react-app with PM2  #expressjs #pm2 #react #javascript #reactjs
  • js on localhost:3000 if no port is providedSteps:npm install -g pm2cd into your project directory then pm2 ecosystemedit ecosystem.config.js with:4.
  • setup: pm2 deploy ecosystem.config.js staging setup6.
  • deploy: pm2 deploy ecosystem.config.js staging7.
  • setup whatever proxy server you want to use.
  • here is an example for nginx:listen 80 default_server;server_name _;location / { proxy_pass http://localhost:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Host $host; proxy_set_header Connection ‘upgrade’; proxy_cache_bypass $http_upgrade; }Gotchas:npm command not found: issue publickey:

Read more


ReactDOM

@ReactDOM: “Deploy create-react-app with PM2 #expressjs #pm2 #react #javascript #reactjs” open tweet »