config.default.ts 641 B

1234567891011121314151617181920212223
  1. import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg';
  2. export default (appInfo: EggAppInfo) => {
  3. const config = {} as PowerPartial<EggAppConfig>;
  4. // override config from framework / plugin
  5. // use for cookie sign key, should change to your own and keep security
  6. config.keys = appInfo.name + '_1687254724720_1708';
  7. // add your egg config in here
  8. config.middleware = [];
  9. // add your special config in here
  10. const bizConfig = {
  11. sourceUrl: `https://github.com/eggjs/examples/tree/master/${appInfo.name}`,
  12. };
  13. // the return config will combines to EggAppConfig
  14. return {
  15. ...config,
  16. ...bizConfig,
  17. };
  18. };