skip to Main Content

I’m not a Node.js developer. So I have no idea how it works. I’ve been a PHP developer for over 8 years.

Because of some reason, I need to make a small change in a Node.js project which is live. All I have to do is changing a payment gateway token. I did it like this:

enter image description here

After pulling it on the server, users still go to the old payment gateway. So I guess I need to do a restart. (I’m saying so because, for PHP projects, when you change a config-related thing, you need to restart PHP).

Not sure should I restart what thing? Noted that, the server is Ubuntu 20.04 and uses Nginx to talk to Node.js. In other word, how can I see Node is running as what service on Linux?


Also, there are two files that I think I need to run the project again after restarting Node through one of them: index.js, server.js. Am I right?

enter image description here

And

enter image description here

2

Answers


  1. Please check if it is a node.js project so you can write the command node index.js or node server.js with this command you can start your node server.

    Login or Signup to reply.
  2. Your Node.js script likely runs under a process that restarts the script in case it dies. There are several "run forever" wrappers, the most popular one is pm2. Find out which one is used in your project. Try pm2 list as the user your project executes under. If pm2 type pm2 restart app_name to restart your project.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search