npm run start- Terminal 1:
npm run watch - Wait for the build to finish
- Terminal 2:
npm run server
Follow these steps to deploy your app to a live server.
This build includes AoT
npm run build:prod- Install NodeJS if you haven't already.
- Run the following command:
npm install pm2 -g
- Setup directory structure for production:
mkdir %projectname% cd %projectname% mkdir prod - Remove source map files from files in
distdirectory. - Copy files inside
distdirectory toproddirectory on your server. cdto the root of your project directory on your server. You have to make sure that you are not inside theproddirectory.- To start your app for production, run the following command:
NODE_ENV=production pm2 start prod/server.js
Based on https://github.com/robwormald/ng-universal-demo