proxy.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * @Author: code4eat awesomedema@gmail.com
  3. * @Date: 2024-04-09 18:07:34
  4. * @LastEditors: code4eat awesomedema@gmail.com
  5. * @LastEditTime: 2025-03-27 14:03:32
  6. * @FilePath: /KC-MiddlePlatform/config/proxy.ts
  7. * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  8. */
  9. const proxy: { [key: string]: any } = {
  10. dev: {
  11. '/gateway': {
  12. //target: 'http://47.96.149.190:5000',
  13. target: 'http://120.27.235.181:5000',
  14. //target: 'http://platform.pre.bs.qjczt.com:5000',
  15. changeOrigin: true,
  16. // pathRewrite: { '^/master': '' },
  17. },
  18. '/api': {
  19. target: 'http://localhost:8088',
  20. changeOrigin: true,
  21. },
  22. '/ai': {
  23. target: 'http://192.168.0.120:5003',
  24. //target: 'http://116.62.47.88:5003',
  25. changeOrigin: true,
  26. pathRewrite: { '^/ai': '' },
  27. selfHandleResponse: true,
  28. onProxyRes: function onProxyRes(proxyRes: any, req: any, res: any) {
  29. proxyRes.on('data', function (data: any) {
  30. res.write(data);
  31. });
  32. proxyRes.on('end', function () {
  33. res.end();
  34. });
  35. },
  36. },
  37. },
  38. mock: {
  39. '/master/': {
  40. target: 'http://localhost:8000',
  41. changeOrigin: true,
  42. pathRewrite: { '^': '' },
  43. },
  44. },
  45. };
  46. export default proxy;