我想把命令行参数传给forever,然后在我的应用程序中解析。
目前我是这样启动我的应用程序的:
forever start -c "node --max-old-space-size=8192 --nouse-idle-notification" /home/ubuntu/node/server.js
我希望能够在我的server.js文件中读取一些参数。
读取参数的代码:
var arguments = process.argv.slice(2);
console.log(arguments[0]);
if(!arguments[0]) {
console.log("Error: Missing port.");
process.exit(1);
}
但是如何告诉forever
传递参数,以便在server.js
内读取?