[feat] added pm2 configs & .env for port
This commit is contained in:
parent
8ab964590d
commit
193cfcc412
1
.env.development
Normal file
1
.env.development
Normal file
@ -0,0 +1 @@
|
|||||||
|
PORT=3000
|
2535
package-lock.json
generated
Normal file
2535
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -9,6 +9,7 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "4.16.1",
|
"@typescript-eslint/eslint-plugin": "4.16.1",
|
||||||
"@typescript-eslint/parser": "4.16.1",
|
"@typescript-eslint/parser": "4.16.1",
|
||||||
"debug": "4.3.1",
|
"debug": "4.3.1",
|
||||||
|
"dotenv": "^10.0.0",
|
||||||
"eslint": "7.21.0",
|
"eslint": "7.21.0",
|
||||||
"eslint-config-prettier": "8.1.0",
|
"eslint-config-prettier": "8.1.0",
|
||||||
"eslint-plugin-prettier": "3.3.1",
|
"eslint-plugin-prettier": "3.3.1",
|
||||||
|
17
pm2.json
Normal file
17
pm2.json
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "webex-collab-dev",
|
||||||
|
"script": "./dist/index.js",
|
||||||
|
"watch": ["src/"],
|
||||||
|
"ignore_watch": [
|
||||||
|
"node_modules",
|
||||||
|
"public"
|
||||||
|
],
|
||||||
|
"autorestart": false,
|
||||||
|
"exec_mode": "fork_mode",
|
||||||
|
"instances": 1,
|
||||||
|
"env": {
|
||||||
|
"NODE_ENV": "development",
|
||||||
|
"TZ": "Europe/London"
|
||||||
|
},
|
||||||
|
"node_args": ["--inspect=127.0.0.1:9320"]
|
||||||
|
}
|
10
pm2production.json
Normal file
10
pm2production.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"name": "webex-collab",
|
||||||
|
"script": "./dist/index.js",
|
||||||
|
"autorestart": true,
|
||||||
|
"exec_mode": "fork_mode",
|
||||||
|
"instances": 1,
|
||||||
|
"env": {
|
||||||
|
"NODE_ENV": "production"
|
||||||
|
}
|
||||||
|
}
|
@ -7,6 +7,12 @@ const serverDebug = debug("server");
|
|||||||
const ioDebug = debug("io");
|
const ioDebug = debug("io");
|
||||||
const socketDebug = debug("socket");
|
const socketDebug = debug("socket");
|
||||||
|
|
||||||
|
require("dotenv").config(
|
||||||
|
process.env.NODE_ENV !== "development"
|
||||||
|
? { path: ".env.production" }
|
||||||
|
: { path: ".env.development" },
|
||||||
|
);
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const port = process.env.PORT || 80; // default port to listen
|
const port = process.env.PORT || 80; // default port to listen
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user