config.default.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 + '_1590486343297_6167';
  15. // add your middleware config here
  16. config.middleware = [];
  17. // add your user config here
  18. const userConfig = {
  19. // myAppName: 'egg',
  20. };
  21. // add your config here
  22. config.cluster = {
  23. listen: {
  24. port: 3001,
  25. },
  26. };
  27. // mongoose config
  28. config.mongoose = {
  29. url: 'mongodb://localhost:27017/count',
  30. // options: {
  31. // user: 'admin',
  32. // pass: 'admin',
  33. // authSource: 'admin',
  34. // useNewUrlParser: true,
  35. // useCreateIndex: true,
  36. // },
  37. };
  38. // // JWT config
  39. config.jwt = {
  40. ...jwt,
  41. expiresIn: '1d',
  42. issuer: 'count',
  43. };
  44. return {
  45. ...config,
  46. ...userConfig,
  47. };
  48. };