config.default.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /* eslint valid-jsdoc: "off" */
  2. 'use strict';
  3. /**
  4. * @param {Egg.EggAppInfo} appInfo app info
  5. */
  6. const { jwt } = require('./config.secret');
  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 + '_1640765284662_2781';
  15. // add your middleware config here
  16. config.middleware = [ 'requestLog' ];
  17. // add your user config here
  18. const userConfig = {
  19. // myAppName: 'egg',
  20. };
  21. // 日志
  22. config.logger = {
  23. level: 'DEBUG',
  24. allowDebugAtProd: true,
  25. };
  26. // mq设置
  27. // config.amqp = {
  28. // client: {
  29. // hostname: '127.0.0.1',
  30. // username: 'freeAdmin',
  31. // password: '1qaz2wsx',
  32. // vhost: 'freeAdmin',
  33. // },
  34. // app: true,
  35. // agent: true,
  36. // };
  37. // // 接收队列名称
  38. // config.queue = 'freeAdmin/server-user';
  39. // // 发送队列名称
  40. // config.sendQueue = {
  41. // logs: 'freeAdmin/server-logs',
  42. // };
  43. // // http请求前缀
  44. // config.httpPrefix = {
  45. // logs: 'http://localhost:13002/freeAdminLog/api',
  46. // };
  47. // redis设置
  48. // config.redis = {
  49. // client: {
  50. // port: 6379, // Redis port
  51. // host: '127.0.0.1', // Redis host
  52. // password: '123456',
  53. // db: 0,
  54. // },
  55. // };
  56. // 进程设置
  57. config.cluster = {
  58. listen: {
  59. port: 6200,
  60. },
  61. };
  62. // jwt设置
  63. config.jwt = {
  64. ...jwt,
  65. expiresIn: '1d',
  66. issuer: 'psychosis',
  67. };
  68. // 数据库设置
  69. config.dbName = 'baoan-psychosis';
  70. config.mongoose = {
  71. // url: `mongodb://192.168.43.105:27017/${config.dbName}`,
  72. // url: `mongodb://localhost:27017/${config.dbName}`,
  73. url: `mongodb://120.48.146.1:27017/${config.dbName}`,
  74. options: {
  75. user: 'admin',
  76. pass: 'admin',
  77. authSource: 'admin',
  78. useNewUrlParser: true,
  79. useCreateIndex: true,
  80. },
  81. };
  82. // 路由设置
  83. config.routePrefix = '/psychosis/api';
  84. // 中间件
  85. config.requestLog = {
  86. toMongoDB: true,
  87. };
  88. config.import = {
  89. // domain: 'http://sps.fwedzgc.com:8090',
  90. domain: 'http://127.0.0.1',
  91. };
  92. return {
  93. ...config,
  94. ...userConfig,
  95. };
  96. };