config.default.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* eslint valid-jsdoc: "off" */
  2. 'use strict';
  3. const { jwt } = require('./config.secret');
  4. /**
  5. * @param {Egg.EggAppInfo} appInfo app info
  6. */
  7. module.exports = appInfo => {
  8. /**
  9. * built-in config
  10. * @type {Egg.EggAppConfig}
  11. **/
  12. const config = exports = {};
  13. // use for cookie sign key, should change to your own and keep security
  14. config.keys = appInfo.name + '_1625713704561_5494';
  15. // add your middleware config here
  16. config.middleware = [];
  17. // add your user config here
  18. const userConfig = {
  19. // myAppName: 'egg',
  20. };
  21. config.cluster = {
  22. listen: {
  23. port: 11111,
  24. },
  25. };
  26. config.appName = 'market';
  27. config.dbName = 'market';
  28. config.mongoose = {
  29. url: `mongodb://localhost:27017/${config.dbName}`,
  30. options: {
  31. // user: 'admin',
  32. // pass: '111111',
  33. // authSource: 'admin',
  34. // useNewUrlParser: true,
  35. // useCreateIndex: true,
  36. },
  37. };
  38. config.amqp = {
  39. client: {
  40. hostname: '127.0.0.1',
  41. username: 'test',
  42. password: '123456',
  43. vhost: 'test',
  44. },
  45. app: true,
  46. agent: true,
  47. };
  48. config.jwt = {
  49. ...jwt,
  50. expiresIn: '1d',
  51. issuer: 'market',
  52. };
  53. config.redis = {
  54. client: {
  55. port: 6379, // Redis port
  56. host: '127.0.0.1', // Redis host
  57. password: '123456',
  58. db: 1,
  59. },
  60. };
  61. return {
  62. ...config,
  63. ...userConfig,
  64. };
  65. };