Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method for nodejs to restart the service?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what is the method of nodejs restart service". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the method of nodejs restart service".

Nodejs restart the service: 1, press the "Ctrl+C" key in the command console to terminate the currently running code; 2, execute the "node filename.js" command to restart the node service.

This tutorial operating environment: linux5.9.8 system, nodejs version 12.19.0, DELL G3 computer.

How to restart the Node service

1. Press Ctrl+C in the command console to terminate the currently running code

2. Then continue node filename.js to restart node.js

Automatically restart the Node service

Node Supervisor was originally used to automatically restart the Node.js application on the server when it crashes. Of course, it can also monitor the js file changes of your project and restart automatically to facilitate debugging.

Install sudo npm install supervisor-g, or use sudo cnpm install supervisor-g.

How to use it:

1. Turn off the node service that was enabled before.

2. Then use the command: supervisor yourApp.js under the project path to open Supervisor. It will open the node service, and constantly detect file changes, when the contents of JS files are modified, automatically restart the service, which is very convenient.

Thank you for your reading. the above is the content of "what is the method for nodejs to restart the service". After the study of this article, I believe you have a deeper understanding of what is the method for nodejs to restart the service, and the specific usage needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report