config.default.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 + '_1578642242928_5726';
  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: 8001,
  30. },
  31. };
  32. // config.amqp = {
  33. // client: {
  34. // hostname: '127.0.0.1',
  35. // username: 'visit',
  36. // password: 'visit123',
  37. // vhost: 'visit',
  38. // },
  39. // app: true,
  40. // agent: true,
  41. // };
  42. // mongoose config
  43. config.mongoose = {
  44. url: 'mongodb://127.0.0.1:27017/visit',
  45. options: {
  46. user: 'admin',
  47. pass: 'admin',
  48. authSource: 'admin',
  49. useNewUrlParser: true,
  50. useCreateIndex: true,
  51. },
  52. };
  53. return {
  54. ...config,
  55. ...userConfig,
  56. };
  57. };