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

export default (appInfo: EggAppInfo) => {
  const config = {} as PowerPartial<EggAppConfig>;
  config.middleware = [ 'parmsDecode', 'getIp', 'proxy' ];

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