Update: build && server frontend
This commit is contained in:
parent
0f70917b7b
commit
38098497a5
3 changed files with 16 additions and 2 deletions
|
|
@ -11,4 +11,4 @@ services:
|
|||
- ./frontend:/data/frontend
|
||||
- ./frontend/node_modules:/data/frontend/node_modules
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
- NODE_ENV=production
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve --host 0.0.0.0",
|
||||
"start": "ng build && node server.js",
|
||||
"build": "ng build",
|
||||
"watch": "ng build --watch --configuration development",
|
||||
"test": "ng test"
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
"@angular/platform-browser-dynamic": "~13.1.1",
|
||||
"@angular/router": "~13.1.1",
|
||||
"bootstrap": "^5.1.3",
|
||||
"express": "^4.17.2",
|
||||
"jquery": "^3.6.0",
|
||||
"popper": "^1.0.1",
|
||||
"rxjs": "~6.6.0",
|
||||
|
|
|
|||
13
frontend/server.js
Normal file
13
frontend/server.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
const path = require('path');
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const port = process.env.PORT || 4200;
|
||||
|
||||
app.use(express.static(__dirname + '/dist/frontend'));
|
||||
app.get('/*', function(req,res) {
|
||||
res.sendFile(path.join(__dirname+ '/dist/frontend/index.html'));
|
||||
});
|
||||
|
||||
app.listen(port, '0.0.0.0',() => {
|
||||
console.log (`listening on port ${port}`);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue