config.default.js 1.0 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: 7901,
  24. },
  25. };
  26. config.jwt = {
  27. ...jwt,
  28. expiresIn: '1d',
  29. issuer: 'pintuan',
  30. };
  31. config.dbName = 'pintuan';
  32. config.mongoose = {
  33. url: `mongodb://localhost:27017/${config.dbName}`,
  34. options: {
  35. // user: 'admin',
  36. // pass: '111111',
  37. // authSource: 'admin',
  38. // useNewUrlParser: true,
  39. // useCreateIndex: true,
  40. },
  41. };
  42. config.wx = {};
  43. return {
  44. ...config,
  45. ...userConfig,
  46. };
  47. };