Skip to content

Commit 1522a29

Browse files
committed
Fix ssr base in production
1 parent 3b64b34 commit 1522a29

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

angular.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@
6767
"maximumError": "20kb"
6868
}
6969
],
70-
"outputHashing": "all"
70+
"outputHashing": "all",
71+
"fileReplacements": [
72+
{
73+
"replace": "projects/budgetkey/src/environments/environment.ts",
74+
"with": "projects/budgetkey/src/environments/environment.prod.ts"
75+
}
76+
]
7177
},
7278
"development": {
7379
"optimization": false,

projects/budgetkey/src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ app.get('*', (req, res, next) => {
8989
* The server listens on the port defined by the `PORT` environment variable, or defaults to 4000.
9090
*/
9191
if (isMainModule(import.meta.url)) {
92-
const port = process.env['PORT'] || 4000;
92+
const port = parseInt(process.env['PORT'] || '4000');
9393
app.listen(port, () => {
9494
console.log(`Node Express server listening on http://localhost:${port}`);
9595
});

0 commit comments

Comments
 (0)