improve: port management
This commit is contained in:
+1
-1
@@ -84,7 +84,7 @@
|
|||||||
"serve": {
|
"serve": {
|
||||||
"builder": "@angular-devkit/build-angular:dev-server",
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
"options": {
|
"options": {
|
||||||
"port": 4200
|
"port": 3000
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {
|
"production": {
|
||||||
|
|||||||
+1
-1
@@ -10,4 +10,4 @@ services:
|
|||||||
dns:
|
dns:
|
||||||
- 192.168.100.2
|
- 192.168.100.2
|
||||||
ports:
|
ports:
|
||||||
- ${MAIN_PORT}:${MAIN_PORT}
|
- ${MAIN_PORT}:3000
|
||||||
|
|||||||
+1
-2
@@ -38,8 +38,7 @@ app.get('**', (req: Request, res: Response, next: NextFunction): void => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (isMainModule(import.meta.url)) {
|
if (isMainModule(import.meta.url)) {
|
||||||
const envPort: number = Number.parseInt(process.env['MAIN_PORT'] ?? '', 10);
|
const port: number = 3000;
|
||||||
const port: number = Number.isFinite(envPort) ? envPort : 3000;
|
|
||||||
|
|
||||||
app.listen(port, (): void => {
|
app.listen(port, (): void => {
|
||||||
console.log(`Listening on port ${port}`);
|
console.log(`Listening on port ${port}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user