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 + '_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.nginxUnit = 'http://192.168.3.45:18080/config/routes/';
  28. config.nginxFilePath = 'http://192.168.3.45:8084';
  29. config.cluster = {
  30. listen: {
  31. port: 9015,
  32. },
  33. };
  34. // 数据库配置
  35. config.mongoose = {
  36. url: 'mongodb://127.0.0.1/Microservices',
  37. options: {
  38. // user: 'root',
  39. // pass: 'cms@cc-lotus',
  40. // authSource: 'admin',
  41. // useNewUrlParser: true,
  42. // useCreateIndex: true,
  43. },
  44. };
  45. config.logger = {
  46. level: 'DEBUG',
  47. };
  48. return {
  49. ...config,
  50. ...userConfig,
  51. };
  52. };