config.default.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 + '_1579225760252_7743';
  14. // add your middleware config here
  15. config.middleware = [];
  16. // add your user config here
  17. const userConfig = {
  18. // myAppName: 'egg',
  19. };
  20. // add your config here
  21. config.cluster = {
  22. listen: {
  23. port: 9008,
  24. },
  25. };
  26. // axios service config
  27. config.axios = {
  28. auth: { // 用户鉴权服务
  29. baseUrl: 'http://localhost:9999/api/auth/user',
  30. },
  31. };
  32. config.mongoose = {
  33. url: 'mongodb://localhost:27017/platform',
  34. options: {
  35. user: 'platform',
  36. pass: 'platform2020',
  37. authSource: 'admin',
  38. useNewUrlParser: true,
  39. useCreateIndex: true,
  40. useUnifiedTopology: true,
  41. },
  42. };
  43. config.amqp = {
  44. client: {
  45. hostname: '127.0.0.1',
  46. username: 'visit',
  47. password: 'visit',
  48. vhost: 'visit',
  49. },
  50. app: true,
  51. agent: true,
  52. };
  53. return {
  54. ...config,
  55. ...userConfig,
  56. };
  57. };