config.default.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 + '_1623739063308_1869';
  15. // add your middleware config here
  16. config.middleware = [ 'tenantUse' ];
  17. // add your user config here
  18. const userConfig = {
  19. // myAppName: 'egg',
  20. };
  21. config.cluster = {
  22. listen: {
  23. port: 9901,
  24. },
  25. };
  26. config.appName = 'st'; // 路由的前缀会引用这个变量,组成接口地址
  27. config.jwt = {
  28. ...jwt,
  29. expiresIn: '1d',
  30. issuer: 'shitang',
  31. };
  32. config.dbName = 'shitang';
  33. config.mongoose = {
  34. url: `mongodb://localhost:27017/${config.dbName}`,
  35. options: {
  36. user: 'admin',
  37. pass: 'admin',
  38. authSource: 'admin',
  39. useNewUrlParser: true,
  40. useCreateIndex: true,
  41. },
  42. };
  43. config.wxApp = {
  44. test: {
  45. appid: 'wxe8b4c4d5e87a7d31',
  46. secret: '60cffc9d8766e8b169db970d2422a647',
  47. },
  48. };
  49. return {
  50. ...config,
  51. ...userConfig,
  52. };
  53. };