config.prod.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import { MidwayConfig } from '@midwayjs/core';
  2. const ip = 'host.docker.internal';
  3. // const redisIp = '172.17.0.1'; // midway里用上面的ip会被转变成127.0.0.1
  4. const baseDB = 'shoppingOne';
  5. const dbName = 'shoppingOne_chat';
  6. const mqUser = 'shoppingOne';
  7. const routePrefix = '/point/one/chat/v1/api';
  8. const suffix = '_local';
  9. export default {
  10. // use for cookie sign key, should change to your own and keep security
  11. keys: '1669597198171_1000',
  12. koa: {
  13. port: 12214,
  14. globalPrefix: routePrefix,
  15. },
  16. webSocket: {
  17. clientTracking: true,
  18. },
  19. mongoose: {
  20. dataSource: {
  21. default: {
  22. uri: `mongodb://${ip}:27017/${dbName}`,
  23. options: {
  24. user: 'admin',
  25. pass: 'admin',
  26. authSource: 'admin',
  27. useNewUrlParser: true,
  28. },
  29. entities: ['./entity/chat'],
  30. },
  31. base: {
  32. uri: `mongodb://${ip}:27017/${baseDB}`,
  33. options: {
  34. user: 'admin',
  35. pass: 'admin',
  36. authSource: 'admin',
  37. useNewUrlParser: true,
  38. },
  39. entities: ['./entity/base'],
  40. },
  41. },
  42. },
  43. jwt: {
  44. secret: 'Ziyouyanfa!@#',
  45. },
  46. axios: {
  47. clients: {
  48. wechat: {
  49. baseURL: 'https://broadcast.waityou24.cn/wechat/api', // http://127.0.0.1:14001/wechat/api
  50. },
  51. base: {
  52. baseURL: 'https://broadcast.waityou24.cn/point/one/v1/api', // http://127.0.0.1:12211
  53. },
  54. },
  55. },
  56. rabbitmq: {
  57. url: `amqp://${mqUser}:${mqUser}@${ip}/${mqUser}`,
  58. },
  59. mqConfig: {
  60. normal: {
  61. ex: `t_m${suffix}`,
  62. },
  63. timeout: 1, //min
  64. },
  65. } as MidwayConfig;