node.js - 初学node有点不懂
怪我咯
怪我咯 2017-04-17 16:04:12
0
7
310
怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(7)
大家讲道理

Problems with your own app.js. Is the http service not started in it, or the listening port number is not printed, so the last sentence is not mentioned. Aren’t everything else the same as the textbook?

Supervisor is just a node service, right? It's just that he acts as the main process and sets up a child process as your service so that it can be easily monitored.

刘奇

Just start it after installation. When you originally wrote node, every time you modified the content of the server, you needed to automatically restart it to take effect. With this superviosr, it will automatically restart the service after you save it.
But, what effect do you want? Check to see if the code is correct. It probably has nothing to do with the supervisor.

左手右手慢动作

Forgive me for not knowing much

Usually the command used to execute a js file is

node app.js

I seesupervisor是一个调试工具,他会创建一个进程去监听的你程序代码的变更,而不需要每次单独使用nodego execute your code.

Actually, I think there is nothing wrong with your execution method. The so-called different prompt information you see may be caused by the system.
Secondly, it is possible that your code and his code are different, so the monitoring results are different.

伊谢尔伦

Put out app.js and take a look.

阿神

Although I don’t know much about node, I know that the startup should be node app.js (app is the name of your node program). Anyway, I have never used the supervisor command

大家讲道理

Follow your cmd prompts, haven’t you already turned on monitoring?

黄舟

It is already running. I think you want to see a running prompt. If so, you can add a sentence at the end of app.js: app.js结尾加一句:

console.log ('server is running on ort')

console.log ('server is running on ort')🎜
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template