Skip to content

Instantly share code, notes, and snippets.

@SongFuZhen
Last active August 12, 2019 07:54
Show Gist options
  • Save SongFuZhen/e059c05fddce90aef77d577b56a40eaa to your computer and use it in GitHub Desktop.
Save SongFuZhen/e059c05fddce90aef77d577b56a40eaa to your computer and use it in GitHub Desktop.

Node Server 热更新方式

使用nodemon实现node server 的热更新

https://github.com/remy/nodemon/

Step1 Install nodemon

推荐使用全局安装

npm install -g nodemon

Step2 配置nodemon

在package.json中配置如下

"nodemonConfig": {
    "ignore": [
      "test/*",
      "docs/*"
    ],
    "delay": "2500"
  }

Step3 使用nodemon运行

nodemon --inspect ./server.js localhost 4000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment