This node application prepares an Angular application to be able to be used on the Heroku environment.
It is assumed your package already has
npm install @angular/cli@latest @angular/compiler-cli --save-dev
-
Copies
@angular/cliand@angular/compiler-clifromdevDependenciestodependencies -
Adds
"postinstall": "ng build --aot -prod"toscripts -
Adds Node and NPM engines
"engines":{ "node":"11.9.0", "npm":"6.11.3" }; -
Copies
"typescript"fromdevDependenciestodependencies -
Install
install [email protected] -
Install Express server with
npm install express path --save -
Creates the
server.jsfile with the correct dist directory -
Change the
"start"command tonode server.js