SailsJS生产模式在localhost上没有响应:1337

时间:2016-05-11 17:39:22

标签: sails.js

这可能是一个非常新手的问题,但我似乎无法让我的Sails.js应用程序在生产模式下工作。我通过设置NODE_ENV = production在生产模式下启动它,它说它已在localhost:1337上成功解除,但是当我尝试转到链接时它只是暂停而没有来自服务器的回复。

Sails.js应用程序在开发模式下运行良好。

通过了所有文档,无法看到遗漏的内容。

我有一个production.js配置文件。

- production.js(匿名端点)---

/**
 * Production environment settings
 *
 * This file can include shared settings for a production environment,
 * such as API keys or remote database passwords.  If you're using
 * a version control solution for your Sails app, this file will
 * be committed to your repository unless you add it to your .gitignore
 * file.  If your repository will be publicly viewable, don't add
 * any private information to this file!
 *
 */

module.exports = {

  minicabit: {
    api: {
      host: "https://api-endpoint",
      prepend: "/vX/",
      key: "wrwerwrwrwewre"
    }
  },
  log: {
    level: 'info'
  },
  csrf: true,

  /***************************************************************************
   * Set the default database connection for models in the production        *
   * environment (see config/connections.js and config/models.js )           *
   ***************************************************************************/

  models: {
    connection: 'connMysql'
  },


  // models: {
  //   connection: 'someMysqlServer'
  // },

  /***************************************************************************
   * Set the port in the production environment to 80                        *
   ***************************************************************************/

  //port: 80,

  /***************************************************************************
   * Set the log level in production environment to "silent"                 *
   ***************************************************************************/

  // log: {
  //   level: "silent"
  // }

  blueprints: {
    rest: false,
    shortcuts: false
  },

  session: {

    /***************************************************************************
     *                                                                          *
     * In production, uncomment the following lines to set up a shared redis    *
     * session store that can be shared across multiple Sails.js servers        *
     ***************************************************************************/

    adapter: 'connect-redis',

    /***************************************************************************
     *                                                                          *
     * The following values are optional, if no options are set a redis         *
     * instance running on localhost is expected. Read more about options at:   *
     * https://github.com/visionmedia/connect-redis                             *
     *                                                                          *
     *                                                                          *
     ***************************************************************************/

    host: 'redis-endpoint',
    port: 6379,
    ttl: 3600
    // db: 0,
    // pass: <redis auth password>,
    // prefix: 'sess:'
  }
};

我错过了什么吗?

由于

1 个答案:

答案 0 :(得分:0)

我发现了这个问题,看起来我安装的connect-redis模块与sail.js不兼容

https://github.com/balderdashy/sails/issues/2379