开始使用PM2时如何将生产模式添加到sailsjs应用程序 [英] How to add production mode to sailsjs app when started using PM2

查看:79
本文介绍了开始使用PM2时如何将生产模式添加到sailsjs应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要在生产模式下启动sailsjs,请附加--prod.

To start sailsjs in production mode you append --prod.

运行: node app.js --prod

我正在使用PM2和一个简单的json文件进行设置,其中包含进程名称和脚本名称,以启动节点进程.

I'm using PM2 and a simple json file for settings, which contains name of process and scriptname, to kick off the node process.

如何使用PM2传递生产参数?

How would I pass the production argument using PM2?

推荐答案

阅读 PM2 JSON应用声明 .例如. (未经测试)

Read PM2 JSON app declaration. E.g. (not tested)

[{
  "name"      : "Sails",
  "script"    : "./app.js",
  "args"      : "['--prod']"
}]

这篇关于开始使用PM2时如何将生产模式添加到sailsjs应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆