This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/devlake.git
The following commit(s) were added to refs/heads/main by this push:
new b3f18854a fix(config-ui): make dev api proxy target configurable via
VITE_DEVLAKE_URL (#9166)
b3f18854a is described below
commit b3f18854ad58b5cf0e9a56c14266af17ae19894f
Author: Keerthan Poojary <[email protected]>
AuthorDate: Thu Sep 24 21:06:08 2026 +0530
fix(config-ui): make dev api proxy target configurable via VITE_DEVLAKE_URL
(#9166)
Allow overriding the Vite dev server /api proxy target using
VITE_DEVLAKE_URL, defaulting to http://localhost:8080. This avoids
modifying the tracked vite.config.ts during local or dev container
development.
---
config-ui/env.example | 3 +++
config-ui/vite.config.ts | 5 ++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/config-ui/env.example b/config-ui/env.example
index e62af0feb..a1bff92ac 100644
--- a/config-ui/env.example
+++ b/config-ui/env.example
@@ -33,6 +33,9 @@
DEVLAKE_DASHBOARD_URL_BITBUCKET=/grafana/d/4LzQHZa4k/bitbucket?orgId=1&var-repo_
DEVLAKE_DASHBOARD_URL_AZUREDEVOPS=/grafana/d/ba7e3a95-80ed-4067-a54b-2a82758eb3dd/azure-devops?orgId=1&var-repo_id=All&var-interval=WEEKDAY
DEVLAKE_DASHBOARD_URL_ASANA=/grafana/d/asana-dashboard?orgId=1
+# Vite dev server DevLake backend target (for `yarn start`)
+# VITE_DEVLAKE_URL=http://localhost:8080
+
# Vite dev server Grafana target (for `yarn start`)
# VITE_GRAFANA_URL=http://localhost:3001
# VITE_GRAFANA_PROTOCOL=http
diff --git a/config-ui/vite.config.ts b/config-ui/vite.config.ts
index 22abbd5f2..cbdde9fa0 100644
--- a/config-ui/vite.config.ts
+++ b/config-ui/vite.config.ts
@@ -21,6 +21,9 @@ import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import svgr from 'vite-plugin-svgr';
+// Allow DevLake API access from the dev server when using Dev Container or
custom host/port
+const devlakeOrigin = process.env.VITE_DEVLAKE_URL || 'http://localhost:8080';
+
// Allow Grafana access from the dev server when using Dev Container
const grafanaProtocol = process.env.VITE_GRAFANA_PROTOCOL || 'http';
const grafanaHost = process.env.VITE_GRAFANA_HOST || 'localhost';
@@ -38,7 +41,7 @@ export default defineConfig({
port: 4000,
proxy: {
'/api': {
- target: 'http://localhost:8080/',
+ target: devlakeOrigin,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\//, ''),
},