Skip to content

Commit

Permalink
Use env vars to resolve base url
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Jul 5, 2024
1 parent 08a33f5 commit 5d48825
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/utils/resolveBasePath.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
export const resolveBasePath = () => {
let baseUrl = window.location.origin;
let baseUrl = import.meta.env.VITE_TAPIS_BASE_URL;
if (import.meta.env.VITE_SERVERLESS_DEPLOYMENT === "false") {
baseUrl = window.location.origin
}

// Direct request from local dev env to dev.develop
if (/127\.0\.0\.1|localhost|0\.0\.0\.0/.test(baseUrl)) {
return 'https://icicleai.tapis.io';
// Use the specified Tapis Base URL if a local deployment is detected
// if (/127\.0\.0\.1|localhost|0\.0\.0\.0/.test(baseUrl)) {
if (/127\.0\.0\.1|localhost/.test(baseUrl)) {
return import.meta.env.VITE_TAPIS_BASE_URL;
}

return baseUrl;
Expand Down

0 comments on commit 5d48825

Please sign in to comment.