We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7810a65 commit d017299Copy full SHA for d017299
rest-api/.env
@@ -1,4 +1,4 @@
1
2
NODE_ENV=development
3
-PORT=9000
+#PORT=9003
4
rest-api/package.json
@@ -11,6 +11,10 @@
11
},
12
"author": "",
13
"license": "MIT",
14
+
15
16
17
18
"devDependencies": {
19
"@types/express": "^4.17.13",
20
"npm-run-all": "^4.1.5",
rest-api/src/server.ts
@@ -25,9 +25,14 @@ function startServer() {
25
26
let port: number;
27
28
- const portArg = process.argv[2];
+ const portEnv = process.env.PORT,
29
+ portArg = process.argv[2];
30
- if (isInteger(portArg)) {
31
+ if (isInteger(portEnv)) {
32
+ port = parseInt(portEnv);
33
+ }
34
35
+ if (!port && isInteger(portArg)) {
36
port = parseInt(portArg);
37
}
38
0 commit comments