oms/backend/config/config.local.js

47 lines
932 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
const db = require('../database/config').development;
/**
* 本地开发环境配置(npm run dev 自动加载)。
* 覆盖 config.default.js 中的数据库连接,并配置 Redis。
*/
module.exports = () => {
const config = {};
// 开发环境监听端口,可通过 EGG_PORT 覆盖
config.cluster = {
listen: {
port: Number(process.env.EGG_PORT || 6090),
hostname: '127.0.0.1',
},
};
config.sequelize = {
...db,
define: {
underscored: true,
charset: 'utf8mb4',
dialectOptions: {
collate: 'utf8mb4_unicode_ci',
},
},
pool: {
max: 10,
min: 0,
idle: 10000,
},
};
config.redis = {
client: {
host: process.env.REDIS_HOST || '127.0.0.1',
port: Number(process.env.REDIS_PORT || 6379),
password: process.env.REDIS_PASSWORD || 'qwe2019',
db: 0,
},
};
return config;
};