config.default.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* eslint valid-jsdoc: "off" */
  2. 'use strict';
  3. /**
  4. * @param {Egg.EggAppInfo} appInfo app info
  5. */
  6. module.exports = appInfo => {
  7. /**
  8. * built-in config
  9. * @type {Egg.EggAppConfig}
  10. **/
  11. const config = exports = {};
  12. // use for cookie sign key, should change to your own and keep security
  13. config.keys = appInfo.name + '_1637024581861_8297';
  14. // add your middleware config here
  15. config.middleware = [];
  16. // add your user config here
  17. const userConfig = {
  18. // myAppName: 'egg',
  19. };
  20. // 安全配置
  21. config.security = {
  22. csrf: {
  23. // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
  24. enable: false,
  25. },
  26. };
  27. config.cluster = {
  28. listen: {
  29. port: 9005,
  30. },
  31. };
  32. config.redis = {
  33. client: {
  34. port: 6379,
  35. host: '127.0.0.1',
  36. password: null,
  37. db: 0,
  38. },
  39. };
  40. config.view = {
  41. defaultViewEngine: 'nunjucks',
  42. mapping: {
  43. '.njk': 'nunjucks',
  44. },
  45. };
  46. config.wxconfig = {
  47. appid: 'wx545cae03cce08392',
  48. appsecret: '5b90761f94b1b26b5119298f661765ba',
  49. // 模板id
  50. adminTemplateId: '',
  51. // 直连商户号
  52. mchid: '',
  53. // 证书序列号
  54. certid: '',
  55. // 私钥
  56. Key: '',
  57. // APIv3密钥
  58. v3Key: '',
  59. };
  60. return {
  61. ...config,
  62. ...userConfig,
  63. };
  64. };