美文网首页
vue项目如何使用代理本地调试

vue项目如何使用代理本地调试

作者: Angrybird233 | 来源:发表于2022-06-29 18:25 被阅读0次
module.exports = {
  publicPath: "/",
  assetsDir: "static",
  productionSourceMap: process.env.NODE_ENV !== "production",
  outputDir: "dist",
  devServer: {
    host: "localhost",
    open: true,
    port: 5001,
    proxy: {
      "^/": {
        target: process.env.VUE_APP_API_ROOT,
        ws: true,
        changeOrigin: true,
        pathRewrite: {
          "^/api": "/api"
        },
        cookieDomainRewrite: "localhost"
      }
    }
  }
};

相关文章

网友评论

      本文标题:vue项目如何使用代理本地调试

      本文链接:https://www.haomeiwen.com/subject/xhhxbrtx.html