永远使用时的Node.js参数

Joo*_*lle 11 node.js forever

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

这是一个我需要将数字和日期传递给节点的示例.它不起作用所以任何帮助将不胜感激.

forever -c 'node 8010 "2014-11-11 12:00:00"' start app.js
Run Code Online (Sandbox Code Playgroud)

Wil*_*ver 17

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

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

forever start app.js 8010 "2014-11-11 12:00:00"
Run Code Online (Sandbox Code Playgroud)

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

  • 嘿@Will Shaver除了params,如果我想传递一些节点特定的参数,如"--prof",它有可能吗? (2认同)
  • @Vipresh我认为你正在寻找这个:永远开始-c"node --harmony_proxies"server.js (2认同)