Skip to content

Commit

Permalink
Fix data-sdk to support local development on production (#192)
Browse files Browse the repository at this point in the history
Co-authored-by: Franklin <[email protected]>
  • Loading branch information
fvolcic and franklinv77 authored Dec 12, 2024
1 parent 981164e commit 8123610
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/data-sdk/src/config/whichFormantApiUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function whichFormantApiUrl(
if (urlParams.get("formant_prod")) {
return "https://api.formant.io";
}

if (urlParams.get("formant_stage")) {
return "https://api-stage.formant.io";
}
Expand All @@ -40,7 +40,17 @@ export function whichFormantApiUrl(
}
}
}
} catch (_) {}

if (host) {
if (host.includes("app-dev.formant.io") || host.includes("localhost")) {
return "https://api-dev.formant.io";
} else if (host.includes("app-stage.formant.io")) {
return "https://api-stage.formant.io";
} else if (host.includes("app.formant.io")) {
return "https://api.formant.io";
}
}
} catch (_) { }

if (host) {
if (host.includes("app-dev.formant.io")) {
Expand Down

0 comments on commit 8123610

Please sign in to comment.