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
dist
directory. - Copy files inside
dist
directory toprod
directory on your server. cd
to the root of your project directory on your server. You have to make sure that you are not inside theprod
directory.- 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