84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
直接x=require(http).createServer.listen的话,哪怕是全局变量也只存在于那个进程中。再次打开node.exe是一个新的进程,变量不存在。请教一旦关了命令行界面,如何才能再访问当时启动的上下文去热操作那个x?总不能每次都重启吧
人生最曼妙的风景,竟是内心的淡定与从容!
Global variables only exist in one process and cannot be called across processes. If you want to debug, write it directly in the js file. After modification, you can only restart. js is a 'semi-compiled' language.
Used under linuxnohup node xxxx.js &Used under windowsstart node xxx.js
nohup node xxxx.js &
start node xxx.js
Configuration like this can be done not in global variables, but in the file system
Global variables only exist in one process and cannot be called across processes. If you want to debug, write it directly in the js file. After modification, you can only restart. js is a 'semi-compiled' language.
Used under linux
nohup node xxxx.js &
Used under windows
start node xxx.js
Configuration like this can be done not in global variables, but in the file system