From c6ddf9ac3f79dd997b1d5145fcc1ed83201d5b60 Mon Sep 17 00:00:00 2001 From: qier222 Date: Mon, 15 Feb 2021 23:40:09 +0800 Subject: [PATCH] chore: use devServer.proxy --- vue.config.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vue.config.js b/vue.config.js index 6e49e9b..b173798 100644 --- a/vue.config.js +++ b/vue.config.js @@ -7,6 +7,15 @@ module.exports = { devServer: { disableHostCheck: true, port: process.env.DEV_SERVER_PORT || 8080, + proxy: { + "^/api": { + target: "http://localhost:3000", + changeOrigin: true, + pathRewrite: { + "^/api": "/", + }, + }, + }, }, pwa: { name: "YesPlayMusic",