config.default.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 =
  14. appInfo.name + '_1579225760252_7743';
  15. // add your middleware config here
  16. config.middleware = [];
  17. // add your user config here
  18. const userConfig = {
  19. // myAppName: 'egg',
  20. };
  21. // add your config here
  22. config.cluster = {
  23. listen: {
  24. port: 9005,
  25. },
  26. };
  27. config.mongoose = {
  28. url: 'mongodb://localhost:27017/platform',
  29. options: {
  30. // user: 'demo',
  31. // pass: 'demo',
  32. // authSource: 'admin',
  33. // useNewUrlParser: true,
  34. // useCreateIndex: true,
  35. // useUnifiedTopology: true,
  36. },
  37. };
  38. // mq config
  39. config.amqp = {
  40. client: {
  41. hostname: '127.0.0.1',
  42. username: 'live',
  43. password: '1qaz2wsx',
  44. vhost: 'live',
  45. },
  46. app: true,
  47. agent: true,
  48. };
  49. return {
  50. ...config,
  51. ...userConfig,
  52. };
  53. };