config.default.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* eslint valid-jsdoc: "off" */
  2. 'use strict';
  3. const code = require('./code');
  4. const files = require('./files');
  5. const cms = require('./cms');
  6. const log = require('./log');
  7. const login = require('./login');
  8. const wx = require('./wx');
  9. const naf = require('./naf');
  10. /**
  11. * @param {Egg.EggAppInfo} appInfo app info
  12. */
  13. module.exports = appInfo => {
  14. /**
  15. * built-in config
  16. * @type {Egg.EggAppConfig}
  17. **/
  18. const config = exports = {};
  19. // use for cookie sign key, should change to your own and keep security
  20. config.keys = appInfo.name + '_1637282221255_6501';
  21. // add your middleware config here
  22. config.middleware = [];
  23. // add your user config here
  24. const userConfig = {
  25. // myAppName: 'egg',
  26. };
  27. // 安全配置
  28. config.security = {
  29. csrf: {
  30. // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
  31. enable: false,
  32. },
  33. };
  34. config.cluster = {
  35. listen: {
  36. port: 18090,
  37. },
  38. };
  39. config.modules = {
  40. login: 'http://127.0.0.1:9000',
  41. code: 'http://127.0.0.1:9001',
  42. files: 'http://127.0.0.1:9002',
  43. naf: 'http://127.0.0.1:9003',
  44. cms: 'http://127.0.0.1:9004',
  45. wx: 'http://127.0.0.1:9005',
  46. log: 'http://127.0.0.1:9006',
  47. };
  48. config.jwt = {
  49. secret: '123456',
  50. };
  51. config.apipath = { code, files, naf, cms, login, wx, log };
  52. return {
  53. ...config,
  54. ...userConfig,
  55. };
  56. };