如何在没有运行命令的情况下使用Node js在Google Cloud Platform中运行新项目,一次又一次地在Google Cloud Shell中运行文件
您可以按照StackOverflow answer中的说明安装管理程序模块。
要安装supervisor模块,请运行以下命令:
npm安装主管-g
然后使用以下命令运行应用程序:
主管-e html,js app.js
这将监视所有.html和.js文件以进行任何更改,并在不重新启动应用程序的情况下更新网页内容。当然,您需要重新加载网页。