config.default.js 790 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* eslint valid-jsdoc: "off" */
  2. 'use strict';
  3. /**
  4. * @param {Egg.EggAppInfo} appInfo app info
  5. */
  6. module.exports = appInfo => {
  7. /**
  8. * built-in config
  9. * @type {Egg.EggAppConfig}
  10. **/
  11. const config = exports = {};
  12. config.security = {
  13. csrf: {
  14. headerName: 'token',
  15. enable: false,
  16. },
  17. domainWhiteList: [ '*' ],
  18. };
  19. // 跨域配置
  20. config.cors = {
  21. origin: '*',
  22. allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS',
  23. };
  24. // use for cookie sign key, should change to your own and keep security
  25. config.keys = appInfo.name + 'Lowkey_52033';
  26. // add your middleware config here
  27. config.middleware = [];
  28. // add your user config here
  29. const userConfig = {
  30. // myAppName: 'egg',
  31. };
  32. return {
  33. ...config,
  34. ...userConfig,
  35. };
  36. };