You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
961 B

  1. module.exports = {
  2. devServer: {
  3. /* proxy: {
  4. '/api': { // 你的目标服务器的请求路径前缀
  5. target: 'https://hwjb.homilychart.com', // 目标服务器的地址
  6. changeOrigin: true, // 是否跨域
  7. secure: false, // 如果是https接口,需要配置这个参数
  8. pathRewrite: {
  9. '^/api': '' // 将 /api 替换为 /testApi,以便正确请求目标服务器的资源
  10. }
  11. }
  12. } */
  13. proxy: {
  14. '/api': { // 你的目标服务器的请求路径前缀
  15. target: 'http://192.168.40.8:9000', // 目标服务器的地址
  16. changeOrigin: true, // 是否跨域
  17. secure: false, // 如果是https接口,需要配置这个参数
  18. pathRewrite: {
  19. '^/api': '' // 将 /api 替换为 /testApi,以便正确请求目标服务器的资源
  20. }
  21. }
  22. }
  23. }
  24. }