refactor: declare variable for devProxyServer (#1220)

This commit is contained in:
远浅 2023-03-01 19:50:43 +08:00 committed by GitHub
parent e43e04b478
commit 71de6613d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,8 @@ import { resolve } from "path";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
const devProxyServer = "http://localhost:8081/";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
@ -10,19 +12,19 @@ export default defineConfig({
port: 3001,
proxy: {
"^/api": {
target: "http://localhost:8081/",
target: devProxyServer,
changeOrigin: true,
},
"^/o/": {
target: "http://localhost:8081/",
target: devProxyServer,
changeOrigin: true,
},
"^/u/\\d*/rss.xml": {
target: "http://localhost:8081/",
target: devProxyServer,
changeOrigin: true,
},
"/explore/rss.xml": {
target: "http://localhost:8081/",
target: devProxyServer,
changeOrigin: true,
},
},