diff --git a/README.md b/README.md index ffb8cc0..ece0721 100644 --- a/README.md +++ b/README.md @@ -39,10 +39,10 @@ To build and launch a dev server: npm start npm run server -To build and launch the distribution server: +To build and launch the production server: - npm run build:dist - npm run server:dist + npm run build:prod + npm run server:prod @@ -62,7 +62,7 @@ On a low-memory machine, eg. a DigitalOcean 512MB instance, you will need to ena To make the application start on boot, run the following: - pm2 start grunt --name dubdiff -- serve:dist + pm2 start npm --name dubdiff -- run serve:prod pm2 startup systemd pm2 save diff --git a/src/server/index.js b/src/server/index.js index dc64b90..4ca968d 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -14,7 +14,8 @@ import {Status, StatusError} from '../common/constants' import render from './render' -const PORT = 8080 +//set use port 8080 for dev, 80 for production +const PORT = (process.env.NODE_ENV !== "production" ? 8080 : 80) const app = express()