config.default.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 + '_1571378739964_3623';
  15. // add your middleware config here
  16. config.middleware = [];
  17. // add your user config here
  18. const userConfig = {
  19. // myAppName: 'egg',
  20. };
  21. config.errorMongo = {
  22. details: true,
  23. };
  24. config.errorHanler = {
  25. details: true,
  26. };
  27. // add your config here
  28. config.cluster = {
  29. listen: {
  30. port: 8103,
  31. },
  32. };
  33. // mongoose config
  34. // config.mongoose = {
  35. // url: 'mongodb://127.0.0.1:27017/smart',
  36. // options: {
  37. // user: 'root',
  38. // pass: 'Ziyouyanfa#@!',
  39. // authSource: 'admin',
  40. // useNewUrlParser: true,
  41. // useCreateIndex: true,
  42. // },
  43. // };
  44. // base路径
  45. config.sendDir = 'http://wx.cc-lotus.info/api.weixin.qq.com/cgi-bin/message/template/send?appid=';
  46. // base路径
  47. config.baseDir = 'http://smart.cc-lotus.info';
  48. // 企业信息url
  49. config.corpsDir = '/api/corp/corps/';
  50. // 学生信息url
  51. config.stusDir = '/api/studentcorp';
  52. // 学生详细信息
  53. config.strDir = '/api/stud/registers/';
  54. // mq config
  55. config.amqp = {
  56. client: {
  57. hostname: '127.0.0.1',
  58. username: 'wy',
  59. password: '1',
  60. vhost: 'smart',
  61. },
  62. app: true,
  63. agent: true,
  64. };
  65. config.mongoose = {
  66. url: 'mongodb://localhost:27017/smart',
  67. options: {
  68. user: 'demo',
  69. pass: 'demo',
  70. authSource: 'admin',
  71. useNewUrlParser: true,
  72. useCreateIndex: true,
  73. useUnifiedTopology: true,
  74. },
  75. };
  76. // JWT config
  77. config.jwt = {
  78. ...jwt,
  79. expiresIn: '1d',
  80. issuer: 'jobs',
  81. };
  82. return {
  83. ...config,
  84. ...userConfig,
  85. };
  86. };