To put on a nodejs server:
1- If you are using angular cli run the command to generate the bundles:
ng build --prod
This will generate the dist folder with all the site's static code.
2- Download the Node js on your development machine
3) After installation, type in the prompt (in the directory one level above the dist folder):
npm init
Answer the console questions (leaving the startup script as index.js)
4- Create an index.js file:
const express = require('express');
const app = express();
app.set('port', 80);
app.use(express.static(__dirname + '/dist'));
app.get('*',function (req, res) {
res.sendFile(__dirname + '/dist/index.html');
});
app.listen(app.get('port'), function() {
console.log('Running on port ', app.get('port'));
});
Your directory structure should be:
home
-dist/
--arquivos html
-index.js
-package.json
To test local run:
npm start