config.default.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. // useNewUrlParser: true,
  53. // useCreateIndex: true,
  54. },
  55. };
  56. config.project = {
  57. zhwl: 'http://127.0.0.1:7002/api/servicezhwl',
  58. userAuth: 'http://127.0.0.1:7003/api/role/auth',
  59. };
  60. // 安全配置
  61. config.security = {
  62. csrf: {
  63. // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
  64. enable: false,
  65. },
  66. };
  67. return {
  68. ...config,
  69. ...userConfig,
  70. };
  71. };