mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-21 22:28:57 +00:00
chore: update dev server config
This commit is contained in:
parent
8c753e9557
commit
6ee6a5166e
@ -2,6 +2,12 @@ import react from "@vitejs/plugin-react-swc";
|
||||
import { resolve } from "path";
|
||||
import { defineConfig } from "vite";
|
||||
|
||||
let devProxyServer = "http://localhost:8082/";
|
||||
if (process.env.DEV_PROXY_SERVER && process.env.DEV_PROXY_SERVER.length > 0) {
|
||||
console.log("Use devProxyServer from environment: ", process.env.DEV_PROXY_SERVER);
|
||||
devProxyServer = process.env.DEV_PROXY_SERVER;
|
||||
}
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
@ -9,13 +15,17 @@ export default defineConfig({
|
||||
host: "0.0.0.0",
|
||||
port: 3000,
|
||||
proxy: {
|
||||
"/api/": {
|
||||
target: "http://localhost:8082/",
|
||||
changeOrigin: true,
|
||||
"^/api": {
|
||||
target: devProxyServer,
|
||||
xfwd: true,
|
||||
},
|
||||
"/s/": {
|
||||
target: "http://localhost:8082/",
|
||||
changeOrigin: true,
|
||||
"^/slash.api.v2": {
|
||||
target: devProxyServer,
|
||||
xfwd: true,
|
||||
},
|
||||
"^/s/": {
|
||||
target: devProxyServer,
|
||||
xfwd: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user