import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg';
import defaultConfig from './config.default';

export default (appInfo: EggAppInfo) => {
  const config = {} as PowerPartial<EggAppConfig>;

  config.mongoose = {
    url: 'mongodb://127.0.0.1/zyz', // 内网
    options: { useNewUrlParser: true, useUnifiedTopology: true },
  };
  config.gmmongoose = {
    url: 'mongodb://127.0.0.1:27017/zyzgm', // 内网
    options: { useNewUrlParser: true, useUnifiedTopology: true },
  };
  config.redis = {
    url: '127.0.0.1', // 内网
    pw: ''
  };
  
  config.decodeParm = true;

  // the return config will combines to EggAppConfig
  return {
    ...defaultConfig(appInfo),
    ...config,
  };
};
