简体   繁体   English

如何在服务器上同时运行 main.js、cros.js 和 server.py

[英]how to run main.js, cros.js and server.py at the same time on a server

I am a newbie.我是新手。 I don't have any idea about this.我对此没有任何想法。 need your help.需要你的帮助。 please help me!请帮我!

I have 3 files main.js, cros.js, and server.py and I want to run these files simultaneously on my digital ocean server .我有3 个文件 main.js、cros.js 和 server.py ,我想在我的数字海洋服务器上同时运行这些文件。 Locally I have to run each file of these files in different vs code windows.在本地,我必须在不同的 vs 代码窗口中运行这些文件的每个文件。 But I want to run these files on the static server.但我想在静态服务器上运行这些文件。

please say me how to run these 3 files at the same time on the server automatically.请告诉我如何自动在服务器上同时运行这三个文件。

Any help will be appreciated!任何帮助将不胜感激!

Assuming you have access to a remote terminal .假设您可以访问远程终端 There, for something trivial:在那里,对于一些微不足道的事情:

node main.js & node cross.js & python server.py &

This will run all three processes in the background.这将在后台运行所有三个进程。 (You'll want to use fg to pull them to the foreground one by one and ctrl+c them.) (你会想使用fg将它们一一拉到前台,然后 ctrl+c 它们。)

For anything more involved, you may want to use a process manager like Foreman .对于更多涉及的内容,您可能需要使用像Foreman这样的流程管理器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM