【发布时间】:2017-06-30 12:25:57
【问题描述】:
我们如何在 node js/sails 中创建不同的开发和生产配置?
另外,管理测试和生产以及后期生产之间的迁移的最佳方法是什么?
【问题讨论】:
我们如何在 node js/sails 中创建不同的开发和生产配置?
另外,管理测试和生产以及后期生产之间的迁移的最佳方法是什么?
【问题讨论】:
使用config/env 文件适当地覆盖您的配置。示例生产文件:
module.exports = {
/***************************************************************************
* Set the default database connection for models in the production *
* environment (see config/connections.js and config/models.js ) *
***************************************************************************/
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"
}
};
你也可以在那里定义一个test.js文件。
您为什么要从测试环境迁移到生产环境?这对我来说听起来不对。
【讨论】: