0

只是由 Procfile 更改,而不是具有以下内容:

process: node process.js

我的设置如下:

env1: NODE_ENV=env1 node process.js
env2: NODE_ENV=env2 node process.js

然而,在这样做之后,运行环境:

foreman start env1

导致进程刚刚终止:

11:04:37 env1.1         | started with pid 1304
11:04:38 env1.1         | process terminated
11:04:38 system         | sending SIGTERM to all processes

有没有人有任何想法?

我发现这篇文章可能很相似(http://stackoverflow.com/questions/8734398/foreman-not-working-with-nginx),但我看不出如何将其应用于 NodeJS,因为大多数人似乎不得不为让 NodeJS 作为守护进程运行。

干杯,马特

4

1 回答 1

0

我找到了一条替代路线来实现我想要的。我在 forman 中将值作为命令行参数传递,以防止这种行为。

http://nodejs.org/docs/latest/api/process.html#process.argv

于 2012-01-10T11:56:05.310 回答