From 4e60e4f16311512d357ed0a8c03815505093135d Mon Sep 17 00:00:00 2001 From: Kirill Maltsev Date: Tue, 8 Dec 2020 16:23:46 +0200 Subject: [PATCH] Add "start" command So the app could be easily deployed to Heroku --- package.json | 3 ++- scripts/server.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8186ec6..55e4e03 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "scripts": { "build": "webpack --config config/webpack.build.js", "start:dev": "node scripts/server.js --mode=development", - "start:prod": "npm run build && node scripts/server.js --mode=production", + "start:prod": "npm run build && npm run start", + "start": "node scripts/server.js --mode=production", "test": "jest", "pretty-quick": "pretty-quick", "format": "prettier --write .", diff --git a/scripts/server.js b/scripts/server.js index 58414ae..e223372 100644 --- a/scripts/server.js +++ b/scripts/server.js @@ -28,5 +28,5 @@ if (server_mode === SERVER_MODES.DEVELOPMENT) { startBackendServer(3000); } else { console.info("Starting server in production mode."); - startBackendServer(8080); + startBackendServer(process.env.PORT || 8080); }