[英]nodejs with pm2 use process mode
I can't find the usage on pm2
github document, How to use --harmony and process arg ? 我在pm2
github文档上找不到用法,如何使用--harmony和处理arg?
node --harmony app.js staging
pm2 start app.js --node-args="--harmony-generators" ??
Declare JSON configuration processes.json: 宣告JSON设定process.json:
{
"apps" : [{
// Application #1
"name" : "worker-app",
"script" : "worker.js",
"args" : ["--toto=heya coco", "-d", "1"],
"watch" : true,
"node_args" : "--harmony",
"merge_logs" : true,
"cwd" : "/this/is/a/path/to/start/script",
"env": {
"NODE_ENV": "production",
"AWESOME_SERVICE_API_TOKEN": "xxx"
}
},{
// Application #2
"name" : "api-app",
"script" : "api.js",
"instances" : 4,
"exec_mode" : "cluster_mode",
"error_file" : "./examples/child-err.log",
"out_file" : "./examples/child-out.log",
"pid_file" : "./examples/child.pid"
}]
}
Then you can run: 然后,您可以运行:
$ pm2 start processes.json
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.