up是Guillermo Rauch开发的工具。每次修改服务器端的代码后,为了让通过浏览器访问能够看到修改后的效果,都要手动去重启服务器,而up就是为了以一种安全可靠的方式来解决这个问题。
安装好up后开始使用。
这是一段server.js服务器代码。
module.exports=require('http').createServer(function(req,res){
res.writeHead(200,{'Content-Type':'text/html'});
res.end('Hello <b>World</b>');
});
保存好后在终端当前目录下输入命令
up --watch --port 80 server
却 显示
Failed to load configuration.
Execute: `up config` to get started!
输入 up config
后 显示
up-config(1) does not exist, try --help
help命令里似乎也没有找到能有帮助的信息
npm的英文文档看了一遍 感觉应该看懂了但是还是有问题。
Thanks for the invitation, I have never used the up you mentioned. I usually use node index.js. If you want to monitor, you can use supervisor.
I haven’t used up, and I haven’t found it either (up is too common, and it’s hard to find what you want with this keyword).
The error message means that you did not provide a config configuration file, but specifically how to provide it and what the content is, you need to read the documentation or see if there is relevant information in --help.
If you want to monitor code changes, you can use supervisor mentioned by @stardew, or you can use nodemon