config.default.ts 800 B

1234567891011121314151617181920212223242526272829303132
  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 + '_1566957124398_592';
  7. // add your egg config in here
  8. config.middleware = [ 'auth' ];
  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. // close csrf check
  18. security: {
  19. csrf: {
  20. enable: false,
  21. },
  22. },
  23. app: {
  24. checkUpdateInterval: 6, // minute
  25. },
  26. };
  27. };