Fix nginx route collision — namespace lakehouse API under /lakehouse/api/
Previous regex routes for /catalog, /storage, /health intercepted main site. Now all lakehouse API calls go through /lakehouse/api/ prefix, stripped by nginx rewrite. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
387ce0074c
commit
b235ef9201
@ -5,13 +5,12 @@ fn api_base() -> String {
|
||||
if let Some(window) = web_sys::window() {
|
||||
if let Ok(origin) = window.location().origin() {
|
||||
if origin.contains("localhost") || origin.contains("127.0.0.1") {
|
||||
// Local dev: UI on :3300, gateway on :3100
|
||||
if let Ok(hostname) = window.location().hostname() {
|
||||
return format!("http://{}:3100", hostname);
|
||||
}
|
||||
}
|
||||
// Production: nginx proxies /catalog, /query, /ai, /storage on same origin
|
||||
return origin;
|
||||
// Production: API proxied under /lakehouse/api/
|
||||
return format!("{}/lakehouse/api", origin);
|
||||
}
|
||||
}
|
||||
"http://localhost:3100".to_string()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user