From 29da2a75b3a83e1c03b16d31a959045b15862b8f Mon Sep 17 00:00:00 2001 From: anti Date: Thu, 9 Apr 2026 19:14:40 -0400 Subject: [PATCH] fix: add localhost:9090 to CORS defaults; revert broken relative-URL and proxy changes --- decnet/env.py | 2 +- decnet_web/src/utils/api.ts | 2 +- decnet_web/vite.config.ts | 8 -------- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/decnet/env.py b/decnet/env.py index fa0c0fb..3d66bc0 100644 --- a/decnet/env.py +++ b/decnet/env.py @@ -57,5 +57,5 @@ DECNET_DEVELOPER: bool = os.environ.get("DECNET_DEVELOPER", "False").lower() == # CORS — comma-separated list of allowed origins for the web dashboard API. # Example: DECNET_CORS_ORIGINS=http://localhost:8080,https://dashboard.example.com -_cors_raw: str = os.environ.get("DECNET_CORS_ORIGINS", "http://localhost:8080,http://localhost:5173") +_cors_raw: str = os.environ.get("DECNET_CORS_ORIGINS", "http://localhost:8080,http://localhost:5173,http://localhost:9090") DECNET_CORS_ORIGINS: list[str] = [o.strip() for o in _cors_raw.split(",") if o.strip()] diff --git a/decnet_web/src/utils/api.ts b/decnet_web/src/utils/api.ts index 8b78ef1..315653a 100644 --- a/decnet_web/src/utils/api.ts +++ b/decnet_web/src/utils/api.ts @@ -1,7 +1,7 @@ import axios from 'axios'; const api = axios.create({ - baseURL: import.meta.env.VITE_API_URL || '/api/v1', + baseURL: import.meta.env.VITE_API_URL || 'http://localhost:8000/api/v1', }); api.interceptors.request.use((config) => { diff --git a/decnet_web/vite.config.ts b/decnet_web/vite.config.ts index 12f020c..8b0f57b 100644 --- a/decnet_web/vite.config.ts +++ b/decnet_web/vite.config.ts @@ -4,12 +4,4 @@ import react from '@vitejs/plugin-react' // https://vite.dev/config/ export default defineConfig({ plugins: [react()], - server: { - proxy: { - '/api': { - target: 'http://localhost:8000', - changeOrigin: true, - }, - }, - }, })