config.default.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 = [];
  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: '111111',
  38. // authSource: 'admin',
  39. // useNewUrlParser: true,
  40. // useCreateIndex: true,
  41. },
  42. };
  43. config.wx = {};
  44. return {
  45. ...config,
  46. ...userConfig,
  47. };
  48. };