zoukankan      html  css  js  c++  java
  • [Whole Web, Node.js, PM2] Restarting your node.js app on code change using pm2

    Aadd watch to the config.json file:

    {
      "apps": [{
        "name": "App1",
        "script": "app1/server.js",
        "log_file": "log/app1.log",
        "error_file": "log/app1-err.log",
        "watch": true,
        "ignore_watch": ["file"]  //inside app1 folder
      },{
        "name": "App2",
        "script": "app2/server.js",
        "log_file": "log/app2.log",
        "error_file": "log/app2-err.log"
      }]
    }
    

    After change app1/server.js, run

    pm2 list
    

    You can see App1's pid is changed, but App2 is not. Because we enable the watch on App1 not on App2.

  • 相关阅读:
    字体
    abstract关键词
    final关键词
    多态
    接口
    java面向对象
    java运算符
    JDK安装
    循环
    TextView控件
  • 原文地址:https://www.cnblogs.com/Answer1215/p/4466515.html
Copyright © 2011-2022 走看看