nodejs里怎么配置本地环境和生产环境
展开全部
最简单的是,配置config,然后根绝线下还是线上,引用不同config配置项.
talk is cheap ,show me the code
var config = {
name: 'xiaoming',
age: '11'
}
var proConfig = {
name: 'xiaoli',
age: '13'
}
exports = module.exports = config;
// exports = module.exports = proconfig; //如果是线上,使用该config
talk is cheap ,show me the code
var config = {
name: 'xiaoming',
age: '11'
}
var proConfig = {
name: 'xiaoli',
age: '13'
}
exports = module.exports = config;
// exports = module.exports = proconfig; //如果是线上,使用该config
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询