【发布时间】:2016-05-11 17:39:22
【问题描述】:
这可能是一个非常新手的问题,但我似乎无法让我的 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:'
}
};
我还有什么遗漏吗?
谢谢
【问题讨论】:
-
这里没有足够的信息来做出有根据的猜测。您可以发布您的
production.js文件的内容吗?
标签: sails.js