I deployed my app to aws EC2 so I need a way of always having this node app running no matter what if the server restart if the app crashes whatever it always need to restart the app.
the app needs to running always. so I use npm start &
is that enough to restart my app?
I've tried to use systemD, but I had error while start the service I've created :
sudo systemctl start nameX.service
Job for nameX.service failed because of unavailable resources or another system error. See "systemctl status ...service" and "journalctl -xeu ....service" for details.
sudo systemctl status nameX.service
nameX.service: Scheduled restart job, restart > systemd[1]: Stopped My Node Server. Failed to load environment file> systemd[1]: ...service: Failed to run 'start' task: No > systemd[1]: ...service: Failed with result 'resources'. systemd[1]: Failed to start My Node Server.