Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 2. Run on shared hosting

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?

like image 212
AndersonDev Avatar asked Apr 11 '16 19:04

AndersonDev


2 Answers

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

like image 115
Pedro Ferreira Avatar answered Sep 19 '22 18:09

Pedro Ferreira


You dont need anything else other than importing a few javascript files in your index.html file.

Check this live example

Download it from plunkr here and extract it to your required folder in your shared hosting, that's all.

Source: https://angular.io/docs/js/latest/quickstart.html

like image 45
user1685442 Avatar answered Sep 20 '22 18:09

user1685442