Skip to content

Commit 8ca9a6c

Browse files
committed
fix(app): use window.location.origin for API URL fallback
When accessing the web UI via non-localhost addresses (e.g., Tailscale IP, LAN IP), the frontend was hardcoded to use http://localhost:4096 as the API URL, causing all API requests to fail. This changes the fallback to use window.location.origin, which dynamically uses the actual server address from which the page was loaded. Fixes anomalyco#5844 Fixes anomalyco#6063
1 parent f057b22 commit 8ca9a6c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/app/src/app.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const url = iife(() => {
3838
if (import.meta.env.DEV)
3939
return `http://${import.meta.env.VITE_OPENCODE_SERVER_HOST ?? "localhost"}:${import.meta.env.VITE_OPENCODE_SERVER_PORT ?? "4096"}`
4040

41-
return "http://localhost:4096"
41+
return window.location.origin
4242
})
4343

4444
export function App() {

0 commit comments

Comments
 (0)