Node express server always shuts down - node.js

I have a angular app running in a universal express server.
I start the server with
nohup node server.js &
exit
The server runs fine, but after a while 5 to 30 Minutes it stops with nothing in the nohup logs.
Same happens with forever or pm2, after a while the server is gone without any hint for the error.
Any ideas how to debug, this is on a hosting environment.
Thanks

Related

Node server delay

I have node js server running a script through pm2 daemon.
sometimes the server cannot be connected to on the first try, a second try and the server can be connected to perfectly.
I have now moved from http to http2 server base.
any suggestions.

Simple way to ping node js app and automatically restart pm2 proccess

We have linux ubuntu 20 server with pm2 and nginx. And two node js app running via pm2. Is there any simple way to monitor some app endpoint and automatically restart pm2 app if this endpoint is not responding? I know about PM2 monitor - but it costs 40 USD for month. Maybe there is another way to configure it?

The Nginx server returns error 502 for some directories (Express Application)

I'm running an express application using nginx web server on Ubuntu. everything works fine but today when I added two more directories using app.get method and re-deploy my app, the new directories won't work and it returns 502 Bad Gateway errors (old directoriesn are working fine). Restarting pm2, nginx and the server itself didn't help. What should I do?
After a couple of hours I realized that the problem was in my code and not relevant to nginx. But because of pm2 the server would not crash to help me find that out.
running normal run command:
node server.js
revealed the mistake

node http server not listening

For some reason my express node.js server won't start anymore. Usually I just run the npm start command in my application folder and the server will start listening. now it is stuck at > node ./bin/www.
> myapp#0.0.0 start C:\Users\...\first-app
> node ./bin/www
I did not change anything significant, just restarted the server and it did not work anymore. This already happened before and I reinstalled express and then it would work again. I just cant reinstall express all the time.
Also changed ports, same result.

My Express Node.JS App times out

I have installed Node.js on my web server plus the dependencies for Express. When I run the command npm start and go to my web site's address using the port 3000 (which I believe the app is set to by default?), it just keeps loading and never loads. Any tipps please on how to fix this?
Try this $ PORT=8080 node app.js. Here app.js is your server config file. I suspect some background servers are running in that port 3000.

Resources