Skip to content

Commit d2df145

Browse files
patel-lyzrclaude
andcommitted
chore(agentos): make vite dev proxy target env-configurable
AGENTOS_API_TARGET env var overrides the hardcoded production api.clawagent.sh target. Defaults preserved (backwards-compatible). Lets developers point `vite dev` at a local computeragent-server without editing the config. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 4b25aa0 commit d2df145

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

agentos/vite.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@ import react from "@vitejs/plugin-react";
55
// proxied to the Node server. For local `vite dev`, proxy /api to the live API
66
// (api.clawagent.sh/agentos/api) and inject the Basic Auth header so the
77
// dashboard works end-to-end against real data without deploying.
8+
// Override AGENTOS_API_TARGET to point at a local server (e.g. http://127.0.0.1:8787).
89
const API_USER = process.env.AGENTOS_API_USER ?? "clawagent";
910
const API_PASS = process.env.AGENTOS_API_PASS ?? "";
11+
const API_TARGET = process.env.AGENTOS_API_TARGET ?? "https://api.clawagent.sh";
1012
const authHeader = "Basic " + Buffer.from(`${API_USER}:${API_PASS}`).toString("base64");
1113

1214
export default defineConfig({
1315
plugins: [react()],
1416
server: {
1517
proxy: {
1618
"/api": {
17-
target: "https://api.clawagent.sh",
19+
target: API_TARGET,
1820
changeOrigin: true,
1921
rewrite: (p) => p.replace(/^\/api/, "/agentos/api"),
2022
headers: { Authorization: authHeader },

0 commit comments

Comments
 (0)