config.default.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 + '_1640765645851_7833';
  14. // add your middleware config here
  15. config.middleware = [];
  16. // add your user config here
  17. const userConfig = {
  18. // myAppName: 'egg',
  19. };
  20. // mq设置
  21. config.amqp = {
  22. client: {
  23. hostname: '127.0.0.1',
  24. username: 'freeAdmin',
  25. password: '1qaz2wsx',
  26. vhost: 'freeAdmin',
  27. },
  28. app: true,
  29. agent: true,
  30. };
  31. // 进程设置
  32. config.cluster = {
  33. listen: {
  34. port: 13002,
  35. },
  36. };
  37. // 数据库设置
  38. config.dbName = 'freeAdmin-logs';
  39. config.mongoose = {
  40. url: `mongodb://localhost:27017/${config.dbName}`,
  41. options: {
  42. user: 'admin',
  43. pass: 'admin',
  44. authSource: 'admin',
  45. useNewUrlParser: true,
  46. useCreateIndex: true,
  47. },
  48. };
  49. // 路由设置
  50. config.routePrefix = '/freeAdminLog/api';
  51. // 接收队列名称
  52. config.queue = 'freeAdmin/server-logs';
  53. // 发送队列名称
  54. config.sendQueue = {
  55. user: 'freeAdmin/server-user',
  56. };
  57. return {
  58. ...config,
  59. ...userConfig,
  60. };
  61. };