Nodejs Hot Deployment Tool-supervisor

Source: Internet
Author: User

You have experienced this situation when developing NODEJS applications, and you must restart Nodejs to reload the application code after you modify the program files in the Nodejs app. This is because Nodejs loads the file once, caches it in memory, reads the file directly from memory, and then modifies the file Nodejs it is not loaded. This design improves performance, but reduces development efficiency.

Frequent restart Nodejs You coder students will be crazy, these little things can be stumped clever program Ape!!!! Already has the former solution, is also a Nodejs application-supervisor. The main principle is: Supervisor will keep watch you apply all of the following files, found that a file has been modified to reload the program files so that the implementation of the deployment, modify the program files immediately after the change can see the results. Ma ' am, no more worrying about my restart Nodejs!

Let's look at how to install and use supervisor

1, prepare Nodejs running environment, preferably installed in the system environment variable, can be executed under any path.

2, installation SUPERVISOR:NPM INSTALL-G Supervisor

3. Use supervisor instead of Nodejs to start the application

Do you see the difference between starting an app with Nodejs and using it? More debug information, while prompting for changes to the watching app directory

4. See what happens after you modify the program files

Supervisor found a file has been modified, and immediately restarted the Nodejs.

Summarize:

1, Nodejs now lacks a lot of application development phase features, but it with an open mind to encourage folk developers to help themselves constantly improve themselves, enrich themselves. And you put all your energy into solving the most central problem in Nodejs.

Nodejs Hot Deployment Tool-supervisor

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.