config.default.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. // use for cookie sign key, should change to your own and keep security
  13. config.keys = appInfo.name + '_1635902541751_9477';
  14. // add your middleware config here
  15. config.middleware = [];
  16. // add your user config here
  17. const userConfig = {
  18. // myAppName: 'egg',
  19. };
  20. // 安全配置
  21. config.security = {
  22. csrf: {
  23. // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
  24. enable: false,
  25. },
  26. };
  27. config.cluster = {
  28. listen: {
  29. port: 9017,
  30. },
  31. };
  32. // 数据库配置
  33. config.mongoose = {
  34. url: 'mongodb://127.0.0.1/Microservices',
  35. options: {
  36. // user: 'root',
  37. // pass: 'cms@cc-lotus',
  38. // authSource: 'admin',
  39. // useNewUrlParser: true,
  40. // useCreateIndex: true,
  41. },
  42. };
  43. config.logger = {
  44. level: 'DEBUG',
  45. };
  46. return {
  47. ...config,
  48. ...userConfig,
  49. };
  50. };