永远使用时的Node.js参数

时间:2023-01-21 19:09:38

I'm currently using forever to run my node.js application in our development environment. What I am currently struggling with is how to pass node.js arguments when using "forever start"

我目前正在使用我的开发环境中运行我的node.js应用程序。我目前正在努力的是如何在使用“forever start”时传递node.js参数

Here is an example where I need to pass a number and a date to node. It's not working so any help would be appreciated.

这是一个我需要将数字和日期传递给节点的示例。它没有用,所以任何帮助都会受到赞赏。

forever -c 'node 8010 "2014-11-11 12:00:00"' start app.js

1 个解决方案

#1


15  

According to the documentation, the script arguments come after the call. https://github.com/nodejitsu/forever

根据文档,脚本参数在调用之后。 https://github.com/nodejitsu/forever

usage: forever [action] [options] SCRIPT [script-options]

用法:forever [action] [options] SCRIPT [script-options]

forever start app.js 8010 "2014-11-11 12:00:00"

The usage of nconf https://github.com/flatiron/nconf in your project is highly recommended to grab those params.

强烈建议您在项目中使用nconf https://github.com/flatiron/nconf来获取这些参数。

#1


15  

According to the documentation, the script arguments come after the call. https://github.com/nodejitsu/forever

根据文档,脚本参数在调用之后。 https://github.com/nodejitsu/forever

usage: forever [action] [options] SCRIPT [script-options]

用法:forever [action] [options] SCRIPT [script-options]

forever start app.js 8010 "2014-11-11 12:00:00"

The usage of nconf https://github.com/flatiron/nconf in your project is highly recommended to grab those params.

强烈建议您在项目中使用nconf https://github.com/flatiron/nconf来获取这些参数。