Angular 2. Run on shared hosting

AndersonDev picture AndersonDev · Apr 11, 2016 · Viewed 11.2k times · Source

I am started with AngularJS 2:

  • Instaled NodeJS
  • Downloaded start project
  • Run on Node

All works!

However how to run it in production on shared hosting (without Node ant not on vps)? How to open in browser by clicking on index.html?

Answer

Pedro Ferreira picture Pedro Ferreira · Jan 23, 2017

You have to command ng build --prod.

This will build your app into the dist folder.
Copy the contents of your dist folder to the public directory of your shared hosting.

Answered here: https://stackoverflow.com/a/40854458/2816279