Skip to content

Commit a413c0e

Browse files
author
App Generator
committed
Added pm2 (production deploy)
1 parent b7cce9c commit a413c0e

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"author": "AppSeed.us",
77
"main": "src/index",
88
"scripts": {
9-
"start": "yarn build && node build/index.js",
9+
"start": "pm2 start production.config.json",
10+
"start-no-daemon": "pm2 start production.config.json --no-daemon",
11+
"start-node": "yarn build && node build/index.js",
1012
"dev": "ts-node-dev src/index.ts",
1113
"test": "jest -i --colors --verbose --detectOpenHandles",
1214
"lint": "eslint src --ext .ts",
@@ -25,6 +27,7 @@
2527
"jsonwebtoken": "^8.5.1",
2628
"mongoose": "^5.13.2",
2729
"passport": "^0.4.1",
30+
"pm2": "^5.1.0",
2831
"passport-jwt": "^4.0.0"
2932
},
3033
"devDependencies": {

production.config.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"apps": [{
3+
"name": "nodejs_api",
4+
"script": "build/index.js",
5+
"instances": 1,
6+
"autorestart": true,
7+
"watch": false,
8+
"time": true,
9+
"env": {
10+
"NODE_ENV": "production"
11+
}
12+
}]
13+
}

0 commit comments

Comments
 (0)