config.default.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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 + '_1587024572540_7742';
  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: 5555,
  25. },
  26. };
  27. config.wxapi = {
  28. // appid: 'wxdf3ed83c095be97a', // 微信公众号APPID
  29. appid: 'wxd794d8f022ffd8c8',
  30. appSecret: 'ceb7f0986c76f227ae3049934c313f22',
  31. baseUrl: 'http://wx.cc-lotus.info', // 微信网关地址
  32. mchid: '1505364491', // 商户ID
  33. mchkey: '1qaz2wsx3edc4rfv5tgb6yhn7ujm8ik9', // 商户key
  34. wxurl: 'https://zb.liaoningdoupo.com/api/onlive/wxpayback',
  35. payurl: 'https://api.mch.weixin.qq.com/pay/unifiedorder',
  36. };
  37. config.proxy = true;
  38. config.hostHeaders = 'x-forwarded-host';
  39. // 服务器发布路径
  40. config.baseUrl = 'https://free.liaoningdoupo.com';
  41. // 认证回调地址
  42. config.authUrl = '/api/onlive/auth';
  43. // 直播appid与key
  44. config.sdkappid = 1400380125;
  45. config.secretkey = 'bea1ac1f8b0a65bc53feb105d290cada9ba26700364b14e48a1939eab4e65f62';
  46. config.mongoose = {
  47. url: 'mongodb://localhost:27017/liveplatform',
  48. options: {
  49. user: 'admin',
  50. pass: 'admin',
  51. authSource: 'admin',
  52. useNewUrlParser: true,
  53. useCreateIndex: true,
  54. useUnifiedTopology: true,
  55. },
  56. };
  57. // redis config
  58. config.redis = {
  59. client: {
  60. port: 6379, // Redis port
  61. host: '127.0.0.1', // Redis host
  62. password: 123456,
  63. db: 0,
  64. },
  65. };
  66. config.amqp = {
  67. client: {
  68. hostname: '127.0.0.1',
  69. username: 'live',
  70. password: 'live',
  71. vhost: 'live',
  72. },
  73. app: true,
  74. agent: true,
  75. };
  76. // 安全配置
  77. config.security = {
  78. csrf: {
  79. // ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
  80. enable: false,
  81. },
  82. };
  83. // // JWT config
  84. config.jwt = {
  85. ...jwt,
  86. expiresIn: '1d',
  87. issuer: 'jobs',
  88. };
  89. config.view = {
  90. defaultViewEngine: 'nunjucks',
  91. mapping: {
  92. '.njk': 'nunjucks',
  93. },
  94. };
  95. return {
  96. ...config,
  97. ...userConfig,
  98. };
  99. };