0
点赞
收藏
分享

微信扫一扫

vue代理设置

ITWYY 2021-09-24 阅读 53
随笔Vue

在vue.config.js中设置

devServer: {
    port: 1888,
    proxy: {
      '/api': {
        //本地服务接口地址
        target: 'http://localhost',
        //远程演示服务地址,可用于直接启动项目
        //target: 'https://saber.bladex.vip/api',
        ws: true,
        pathRewrite: {
          '^/api': '/'
        }
      }
    }
  }
举报

相关推荐

0 条评论