繁体   English   中英

在PM2上运行两个React Client

[英]Running two react clients on PM2

我正在尝试使用从pm2开始的npm运行两个客户端,但是我没有想出一种为每个客户端创建某种别名的方法。 它们都在不同的端口上运行,我试图使用

pm2 start npm

在每一个上,但它只开始一个而忽略另一个

我们可以添加在其他端口上运行的应用程序列表。 这是我项目中的示例process.json。 API在3001端口上运行,而storeapp在3000端口上运行。

        {
            "name": "api",
            "script": "./src/api/server/index.js",
            "node_args": "-r esm",
            "watch": ["./config/server.js", "./src/api/server/"],
            "instances": "1",
            "exec_mode": "fork",
            "watch_options": {
                "persistent": true,
                "ignoreInitial": false
            }
        },
        {
            "name": "storeapp",
            "script": "./dist/store/server/index.js",
            "node_args": "-r esm",
            "watch": [
                "./config/server.js",
                "./theme/assets/index.html"
            ],
            "instances": "1",
            "exec_mode": "fork",
            "watch_options": {
                "persistent": true,
                "ignoreInitial": false
            }
        }
    ]
}

```

暂无
暂无

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

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