config.default.js 917 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 + '_1618556380571_5956';
  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: 9200,
  29. },
  30. };
  31. config.security = {
  32. csrf: {
  33. enable: false,
  34. type: 'ctoken',
  35. useSession: true,
  36. },
  37. };
  38. config.project = {
  39. main: 'http://127.0.0.1:9201',
  40. };
  41. return {
  42. ...config,
  43. ...userConfig,
  44. };
  45. };