config.default.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 + '_1595930154281_6868';
  14. // add your middleware config here
  15. config.middleware = [];
  16. // add your user config here
  17. const userConfig = {
  18. // myAppName: 'egg',
  19. };
  20. config.proxy = true;
  21. config.hostHeaders = 'x-forwarded-host';
  22. config.wxapi = [{
  23. appid: 'wxdf3ed83c095be97a', // 微信公众号APPID
  24. appSecret: '748df7c2a75077a79ae0c971b1638244',
  25. baseUrl: 'http://broadcast.waityou24.cn/', // 微信网关地址
  26. }];
  27. config.errorMongo = {
  28. details: true,
  29. };
  30. config.errorHanler = {
  31. details: true,
  32. };
  33. // add your config here
  34. config.cluster = {
  35. listen: {
  36. port: 1111,
  37. },
  38. };
  39. // redis config
  40. config.redis = {
  41. client: {
  42. port: 6379, // Redis port
  43. host: '127.0.0.1', // Redis host
  44. password: 123456,
  45. db: 0,
  46. },
  47. };
  48. config.amqp = {
  49. client: {
  50. hostname: '127.0.0.1',
  51. username: 'visit',
  52. password: 'visit',
  53. vhost: 'visit',
  54. },
  55. app: true,
  56. agent: true,
  57. };
  58. config.view = {
  59. defaultViewEngine: 'nunjucks',
  60. mapping: {
  61. '.njk': 'nunjucks',
  62. },
  63. };
  64. return {
  65. ...config,
  66. ...userConfig,
  67. };
  68. };