Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run ng serve without building first

I need to BUILD my app using ng build --prod on machine #1 and to SERVE my app using ng serve --prod on machine #2

Machine #2 should NOT have the source files and has not the processing/RAM capacity to bundle them anyway.

I can't find a way to serve the already bundled files.

Any idea ?

like image 923
Max Avatar asked Nov 24 '16 16:11

Max


1 Answers

You could simply install a node Web Server on machine #2

npm install http-server -g
cd dist
http-server

At https://www.npmjs.com/package/http-server you'll find more information

like image 132
Philip Avatar answered Sep 22 '22 16:09

Philip