config.default.js 1016 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 + '_1618555135007_514';
  15. // add your middleware config here
  16. config.middleware = [];
  17. // add your user config here
  18. const userConfig = {
  19. // myAppName: 'egg',
  20. };
  21. config.jwt = {
  22. ...jwt,
  23. expiresIn: '1d',
  24. issuer: 'test',
  25. };
  26. config.cluster = {
  27. listen: {
  28. port: 9201,
  29. },
  30. };
  31. config.dbName = 'hnh-main';
  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. return {
  43. ...config,
  44. ...userConfig,
  45. };
  46. };