Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 2 without Webserver

How can I use Angular 2 in production without webserver and just the filesystem? I can't use a webserver because of the corporate policies (that was not a problem with Angular because I could use the filesystem).

like image 650
Nono RAM Avatar asked Jul 10 '26 11:07

Nono RAM


1 Answers

If you don't need network, Angular (version 2 and higher) applications work with no problems over the file:/ protocol. But you must set a correct base href path in your index.html. If you are using Angular CLI, you can build the app using the following command:

ng build --base-href=/path/to/your/application/dist/

and then opening the file:///path/to/your/application/dist/index.html in your browser.

like image 108
Ján Halaša Avatar answered Jul 15 '26 09:07

Ján Halaša