config.default.ts 902 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { MidwayConfig } from '@midwayjs/core';
  2. const ip = '127.0.0.1';
  3. const project = 'follow23';
  4. export default {
  5. // use for cookie sign key, should change to your own and keep security
  6. keys: '1697684406848_4978',
  7. koa: {
  8. port: 8890,
  9. globalPrefix: '/visit/api',
  10. },
  11. jwt: {
  12. secret: 'Ziyouyanfa!@#',
  13. expiresIn: '2d',
  14. },
  15. mongoose: {
  16. dataSource: {
  17. default: {
  18. uri: `mongodb://${ip}:27017/${project}`,
  19. options: {
  20. user: 'admin',
  21. pass: 'admin',
  22. authSource: 'admin',
  23. useNewUrlParser: true,
  24. },
  25. entities: ['./entity'],
  26. },
  27. },
  28. },
  29. redis: {
  30. client: {
  31. port: 6379, // Redis port
  32. host: ip, // Redis host
  33. password: '123456',
  34. db: 4,
  35. },
  36. },
  37. rabbitmq: {
  38. url: 'amqp://visit:visit@127.0.0.1/visit',
  39. },
  40. upload: {
  41. whitelist: null,
  42. },
  43. } as MidwayConfig;