在本地计算机中运行服务器,而无需显示CMD窗口
我使用Express创建了我的Node.js应用程序,现在我想将其上传到本地服务器计算机上。 我已经创建了一个BAT文件(我将使用任务计划者运行此功能),该文件基本上移至文件夹应用程序并启动“ NPM运行启动”。
问题是:有一种更正确的方法吗? (没有云),是否可以隐藏CMD窗口?
I' ve created my node.js app with express, now i want to upload it on my local server machine.
I've created a bat file (I will use task planner to run this) that basically move to folder app and launch "npm run start".
The question is: There's a more correct way to this? (no cloud) and is it possible to hide the cmd window?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可以使用
只需在计算机上全球安装PM2:
然后使用PM2启动您的应用程序:
您可以做一些配置,所以我建议您查看他们的 repo
Putting a node.js application to production can be done with pm2. Pm2 will spin up your application and keep it alive, without having any terminal/cmd open.
Simply install pm2 globally on your machine:
Then launch your application with pm2:
There are some configurations you could do, so I suggest you look at their repo