config.default.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 + '_1603878155652_3375';
  14. // add your middleware config here
  15. config.middleware = [];
  16. // add your user config here
  17. const userConfig = {
  18. // myAppName: 'egg',
  19. };
  20. config.cluster = {
  21. listen: {
  22. port: 4001,
  23. },
  24. };
  25. // mq配置
  26. config.amqp = {
  27. client: {
  28. hostname: '127.0.0.1',
  29. username: 'visit',
  30. password: 'visit',
  31. vhost: 'platform',
  32. },
  33. app: true,
  34. agent: true,
  35. };
  36. // redis config
  37. config.redis = {
  38. client: {
  39. port: 6379, // Redis port
  40. host: '127.0.0.1', // Redis host
  41. password: '',
  42. db: 0,
  43. },
  44. };
  45. // mongoose config
  46. config.mongoose = {
  47. url: 'mongodb://127.0.0.1:27017/mission',
  48. options: {
  49. user: 'admin',
  50. pass: 'admin',
  51. authSource: 'admin',
  52. useUnifiedTopology: true,
  53. useNewUrlParser: true,
  54. useCreateIndex: true,
  55. },
  56. };
  57. config.project = {
  58. zhwl: 'http://127.0.0.1:7002/api/servicezhwl',
  59. userAuth: 'http://127.0.0.1:7003/api/role/auth',
  60. };
  61. // 安全配置
  62. config.security = {
  63. csrf: {
  64. // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
  65. enable: false,
  66. },
  67. };
  68. return {
  69. ...config,
  70. ...userConfig,
  71. };
  72. };