【问题标题】:sails js set environment productionSails js设置环境制作
【发布时间】:2016-03-28 18:21:58
【问题描述】:

我尝试在我的服务器上设置 node_env=production 它不起作用 当我尝试运行时

sails lift --prod 

我有一个错误

    Warning: connect.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and will not scale past a single process.
Warning: connect.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and will not scale past a single process.

帆在 1337 端口运行 我使用此命令设置端口转发

sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000

现在我在 80 端口上运行了 Sails 应用程序 但仍然航行环境发展 我需要改变环境来管理我的资产
我的 production.js 文件:-

  appUrl:'http://myserver.me/'

   models: {
    connection: 'someMysqlServer'
   },
   port: 80,

当我使用时

sails.config.appUrl

输出 :- http://localhost:1337 从 development.js 返回而不是 production.js

【问题讨论】:

    标签: node.js deployment sails.js


    【解决方案1】:

    我找到了这里提到的解决方案:How to add production mode to sailsjs app when started using PM2

    pm2 start app.js -x --prod
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-31
      • 1970-01-01
      • 1970-01-01
      • 2021-08-10
      • 1970-01-01
      • 2019-03-24
      • 1970-01-01
      • 2017-08-30
      相关资源
      最近更新 更多