Hi i want to know that how to run angular application permanently. means if i run the npm start command on local server. then after it gives a url with port like localhost:4200. but when i close the terminal then my project not run. Same thing happen with me on live server when i run my command through putty. ng serve --host {ipadddress}. then it gives me a URL like mysiteip:4200. but when i close putty my site not run. i want to know that how to run angular application permanently.
Asked
Active
Viewed 2,697 times
3 Answers
0
You could just send process into background by adding &

asdfgh
- 2,823
- 4
- 21
- 26
-
thanks asdfgh but how to send process into background..? – Irshad Mar 16 '18 at 12:43
0
You can use
forever start node_modules/@angular/cli/bin/ng serve --host {ip_address or domain} --prod
Reference - https://github.com/angular/angular-cli/issues/4951
Instead of this, You can build your app and just drop everything you got in dist folder of your angular app into the directory of the hosting platform.

Krishna
- 154
- 4
- 14
-
-
-
one more thing Krishna Sahu. that how can i stop or restart that process again...?. – Irshad Mar 17 '18 at 11:35
-
https://stackoverflow.com/questions/49359290/command-to-stop-infinte-running-angular-server/49359871#49359871 Irshad. Check out this answer. – Krishna Mar 19 '18 at 10:07
0
I would recommend the screen
command on linux/unix systems
screen
// New shell opens
ng serve --host {ipadddress}
// Now putty can be closed
This is a terminal that persists and can be continued.
screen -r
// Lists all active screen sessions
screen -r SCREEN_TTY_NO
But I would advise to not use this in a productive environment.

Bernhard
- 4,855
- 5
- 39
- 70