mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-20 22:07:15 +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 { resolve } from "path";
|
||||||
import { defineConfig } from "vite";
|
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/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
@ -9,13 +15,17 @@ export default defineConfig({
|
|||||||
host: "0.0.0.0",
|
host: "0.0.0.0",
|
||||||
port: 3000,
|
port: 3000,
|
||||||
proxy: {
|
proxy: {
|
||||||
"/api/": {
|
"^/api": {
|
||||||
target: "http://localhost:8082/",
|
target: devProxyServer,
|
||||||
changeOrigin: true,
|
xfwd: true,
|
||||||
},
|
},
|
||||||
"/s/": {
|
"^/slash.api.v2": {
|
||||||
target: "http://localhost:8082/",
|
target: devProxyServer,
|
||||||
changeOrigin: true,
|
xfwd: true,
|
||||||
|
},
|
||||||
|
"^/s/": {
|
||||||
|
target: devProxyServer,
|
||||||
|
xfwd: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user