[英]node js development production configurations
我们如何在节点js / sail中创建不同的开发和生产配置?
此外,什么是管理测试与生产以及后期生产之间迁移的最佳方法?
使用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
文件。
为什么要从测试环境迁移到生产环境? 这对我来说听起来是错误的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.