P
P
podguzovvasily2019-06-10 11:06:06
Angular
podguzovvasily, 2019-06-10 11:06:06

Running an Angular app on a server in the background?

Hello! Please tell me how to run Angular in the background, so that when the console is closed, the application would continue to work. You need a tool like pm2. I will also be grateful for an example of yml code for docker-compose, which will pull running and starting when Angular is loaded. Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Pikat, 2019-06-10
@PavelPikat

I suspect that by "working Angular" you mean the Webpack development server that you have running in the console via an npm script. Accordingly, when you close the console, dev-server stops.
So, you completely misunderstood the principle of operation of node, Webpack and Angular in general, if you think that all this should work in the production.
Angular is not a process or a program to be run. All Angular code is compiled into JavaScript which is loaded along with the HTML of the website hosted on the server.
I advise you to start with the Angular documentation to understand what it is and how it works - https://angular.io/docs

V
Vladimir, 2019-06-10
@Casufi

Angular deals with dynamic DOM rendering and tools to bind complex logic to DOM rendering. In order to perform tasks in the background, there is https://developer.mozilla.org/en-US/docs/Web/API/W...
Pulling a working Angular is how? Do you want to run nginx to "serve" a static page made in Angular? Or do you want to open the browser in which the application will run on the angular?
What do you mean by "working angular"?
If we are talking about a simple deployment of an application to production, then here is
https://angular.io/guide/deployment
And this is how to make a docker file that will be collected for production and deployed to docker
https://medium.com/@tiangolo/ angular-in-docker-wit...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question