Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 以编程方式监视并重新启动节点服务器_Node.js_Apache_Webserver - Fatal编程技术网

Node.js 以编程方式监视并重新启动节点服务器

Node.js 以编程方式监视并重新启动节点服务器,node.js,apache,webserver,Node.js,Apache,Webserver,每次我想将更改推送到托管我的网站的服务器时,我都厌倦了使用FileZilla,因此我设置了一个github repo并将其链接到我的服务器,以便更改和推送到服务器 但是,我的后端是在node中编写的,因此每次更新server.js文件时,我都必须重新启动服务器。使用“node server.js” 是否有方法在检测到更新时监视文件并以编程方式重新启动节点服务器 如果有帮助的话,我的服务是运行apache2的Ubuntu Linux,你可以自己写一些东西,或者使用已经存在的流行库之一: supe

每次我想将更改推送到托管我的网站的服务器时,我都厌倦了使用FileZilla,因此我设置了一个github repo并将其链接到我的服务器,以便更改和推送到服务器

但是,我的后端是在node中编写的,因此每次更新server.js文件时,我都必须重新启动服务器。使用“node server.js”

是否有方法在检测到更新时监视文件并以编程方式重新启动节点服务器


如果有帮助的话,我的服务是运行apache2的Ubuntu Linux,你可以自己写一些东西,或者使用已经存在的流行库之一:

  • supervisor server.js
  • nodemon server.js

谢谢!我试着搜索,但我想我搜索得不够深!