How do I keep my Angular application running permanently?

Asked

Viewed 382 times

0

To keep the Nodejs server running permanently on the computer is the following procedure;

$ npm install forever
$ forever start server.js

However, how do I make my Angular application run permanently on the computer?

If I restart my computer it would be running my Angular application.

  • Your application is running inside or outside a web browser?

  • My application runs on a web browser

  • 2

    So, if the server is running automatically the application will also be, provided that the web server is making all the necessary files available to the clients (type: the server goes up and the HTML, CSS, JS, images etc pages are already available).

  • I’ll take a test today I give back.

  • After copying the contents of the dist folder and just copy to any web server that should work.

  • in both cases did not catch, if I put the dist folder in the server Tomcat does not catch, if I take and run the command Forever start server.js it even goes up the application, but it is not in the automatic, if I restart the pc and then try to access the page it does not go up.

Show 1 more comment

1 answer

1

If your question is related to the Angular2 application+...

The correct way to let an Angular application run permanently is to build for production and put it on a web server. If you are going to use it on your computer, I recommend using XAMPP (http://www.apachefriends.org)

ng build --prod

After that copy the contents of the dist folder to the htdocs folder of xampp. Remember to leave xampp as a service to start automatically.

  • where the http folder of xampp is?

  • i believe that this approach works the problem is that I am trying to run Java and Angular locally on the same machine, and with this I do not know how to put the War file inside the xampp to move the application up :(

  • The path to the xampp folder is c:... xampp htdocs your project. Access via http browser://localhost/your project

  • you can run xampp and java on the same machine, no problem

Browser other questions tagged

You are not signed in. Login or sign up in order to post.