config.default.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 + '_1571378739964_3623';
  14. // add your middleware config here
  15. config.middleware = [];
  16. // add your user config here
  17. const userConfig = {
  18. // myAppName: 'egg',
  19. };
  20. config.errorMongo = {
  21. details: true,
  22. };
  23. config.errorHanler = {
  24. details: true,
  25. };
  26. // add your config here
  27. config.cluster = {
  28. listen: {
  29. port: 8107,
  30. },
  31. };
  32. config.baseUrl = 'http://localhost:8101/api';
  33. // mongoose config
  34. config.mongoose = {
  35. url: 'mongodb://127.0.0.1:27017/smart',
  36. options: {
  37. user: 'root',
  38. pass: 'Ziyouyanfa#@!',
  39. authSource: 'admin',
  40. useNewUrlParser: true,
  41. useCreateIndex: true,
  42. },
  43. };
  44. // mq配置
  45. config.amqp = {
  46. client: {
  47. hostname: '127.0.0.1',
  48. username: 'smart',
  49. password: 'smart123',
  50. vhost: 'smart',
  51. },
  52. app: true,
  53. agent: true,
  54. };
  55. return {
  56. ...config,
  57. ...userConfig,
  58. };
  59. };