在文件更改时重新启动Heroku本地? [英] Restart Heroku local on file change?

查看:150
本文介绍了在文件更改时重新启动Heroku本地?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来本地服务器以heroku local web开始并不会监视文件更改并重新启动。我怎样才能做到这一点?

解决方案

最简单的方法是使用运行nodemon, heroku local 作为可执行文件 - 即 nodemon --execheroku local。不过,> heroku local 会退出,其中的默认节点关机信号(SIGUSR2)为非零退出代码,所以你需要给nodemon添加一个额外的标志来设置中断信号为SIGTERM。



nodemon --execheroku local--signal SIGTERM



(用heroku-cli@6.14.31-33a2d0a,nodemon@1.12.1,node@8.5.0测试) p>

It seems the local server started with "heroku local web" does not watch for file changes and restart itself. How can I make it do this?

解决方案

The easiest way to do this is to run nodemon with heroku local as the executable - i.e. nodemon --exec "heroku local".

However, heroku local exits with a non-zero exit code for the default nodemon shutdown signal (SIGUSR2), so you need to add an additional flag to nodemon to set the interrupt signal to SIGTERM.

nodemon --exec "heroku local" --signal SIGTERM

(tested with heroku-cli@6.14.31-33a2d0a, nodemon@1.12.1, node@8.5.0)

这篇关于在文件更改时重新启动Heroku本地?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆