mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-05-01 23:16:31 +02:00
Have Task choose free ports for dev servers (#6145)
This commit is contained in:
@@ -39,6 +39,16 @@ export default defineConfig(({ mode }) => {
|
||||
|
||||
const tsconfigProject = TSCONFIG_MAP[effectiveMode];
|
||||
|
||||
// Backend proxy target: default localhost:8080. Override via BACKEND_URL env var
|
||||
// so the top-level dev launcher can wire a dynamically-assigned backend port.
|
||||
const backendUrl = process.env.BACKEND_URL || "http://localhost:8080";
|
||||
const backendProxy = {
|
||||
target: backendUrl,
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
xfwd: true,
|
||||
};
|
||||
|
||||
return {
|
||||
plugins: [
|
||||
react(),
|
||||
@@ -88,48 +98,13 @@ export default defineConfig(({ mode }) => {
|
||||
effectiveMode === "desktop"
|
||||
? undefined
|
||||
: {
|
||||
"/api": {
|
||||
target: "http://localhost:8080",
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
xfwd: true,
|
||||
},
|
||||
"/oauth2": {
|
||||
target: "http://localhost:8080",
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
xfwd: true,
|
||||
},
|
||||
"/saml2": {
|
||||
target: "http://localhost:8080",
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
xfwd: true,
|
||||
},
|
||||
"/login/oauth2": {
|
||||
target: "http://localhost:8080",
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
xfwd: true,
|
||||
},
|
||||
"/login/saml2": {
|
||||
target: "http://localhost:8080",
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
xfwd: true,
|
||||
},
|
||||
"/swagger-ui": {
|
||||
target: "http://localhost:8080",
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
xfwd: true,
|
||||
},
|
||||
"/v1/api-docs": {
|
||||
target: "http://localhost:8080",
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
xfwd: true,
|
||||
},
|
||||
"/api": backendProxy,
|
||||
"/oauth2": backendProxy,
|
||||
"/saml2": backendProxy,
|
||||
"/login/oauth2": backendProxy,
|
||||
"/login/saml2": backendProxy,
|
||||
"/swagger-ui": backendProxy,
|
||||
"/v1/api-docs": backendProxy,
|
||||
},
|
||||
},
|
||||
base: env.RUN_SUBPATH ? `/${env.RUN_SUBPATH}` : "./",
|
||||
|
||||
Reference in New Issue
Block a user