config.default.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 + '_1636438487607_1819';
  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: 18094,
  30. },
  31. };
  32. // 数据库配置
  33. config.mongoose = {
  34. // url: 'mongodb://127.0.0.1:27018/Microservices',
  35. url: 'mongodb://172.17.116.7:27018/Microservices',
  36. options: {
  37. user: 'root',
  38. pass: 'cms@cc-lotus',
  39. authSource: 'admin',
  40. useNewUrlParser: true,
  41. useCreateIndex: true,
  42. },
  43. };
  44. config.logger = {
  45. level: 'DEBUG',
  46. };
  47. return {
  48. ...config,
  49. ...userConfig,
  50. };
  51. };