supervisor使用

来源:互联网 发布:启明星bsc软件 编辑:程序博客网 时间:2024/06/02 05:06

nodeJS调试小工具(修改代码直接刷新浏览器即可):
supervisor
windows安装:
npm install -g supervisor
linux安装:
需要获得管理员权限,
sudo npm install -g supervisor
启动:
supervisor app.js

DEBUG: Running node-supervisor with
DEBUG: program ‘app.js’
DEBUG: –watch ‘.’
DEBUG: –extensions ‘node|js’
DEBUG: –exec ‘node’
DEBUG: Starting child process with ‘node app.js’
DEBUG: Watching directory ‘/home/byvoid/.’ for changes.
HTTP server is listening at port 300
当代码被改动时,脚本终止执行,然后重新启动:
DEBUG: crashing child
DEBUG: Starting child process with ‘node app.js’
HTTP server is listening at port 3000.

原创粉丝点击