我尝试了 express-livereload ,但它只是重新加载了视图文件。
I tried express-livereload, but it just reloaded view files.
我是否应该使用其他工具,或者这个可以配置为监视运行服务器的 index.js 文件?
Should I use another tool, or this one can be configured to watch for my index.js file which runs the server?
我读过那个选项与 node-livereload 相同,监视文件的默认值包括 .js 文件。
I read that options are the same as node-livereload, and default for watched files include .js files.
您使用简单配置知道的任何URL?
Any URL you know with a simple configuration?
我的主要问题是如何为Express.js设置良好的开发环境,以及我想在我提出请求时检查变量,每次在路线上进行更改都会很难重启。
My main problem is how to setup good development environment for Express.js, and I would like to inspect the variables when I am making a request, is painful to restart each time I make a change in a route.
PS我试过 node-inspector 在服务器处理请求时检查变量,但似乎 node-inspector 不适用于此,对吧?
PS I tried node-inspector to inspect variables when server handles a request, but it seems node-inspector is not intended for that, right?
推荐答案我认为 Nodemon 有你想要的。
Nodemon 是一个实用程序,它将监视源中的任何更改并自动重新启动你的服务器。完美的发展。
Nodemon is a utility that will monitor for any changes in your source and automatically restart your server. Perfect for development.
示例调用:
nodemon index.js更多推荐
重新加载Express.js路由更改,而无需手动重新启动服务器
发布评论