Skip to content

Commit

Permalink
use vite.config for home-base url
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewjosephtaylor committed Sep 5, 2024
1 parent 53666c0 commit a02cffa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/EXTERNAL_GLOBALS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ declare const __BUILD_TIMESTAMP__: string;
declare const __APP_VERSION__: string;
declare const __PAP_ID__: string;
declare const __APP_FRONT__: string;
declare const __HOME_BASE__: string;
3 changes: 2 additions & 1 deletion src/state/findHomebaseUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ export const findHomebaseUrl = (): string | undefined => {

// DANGER we need to determine which backend to connect to based on how the UI is accessed
// IF/when new environments are added this will need to be updated/maintained
let homeBaseUrl: string | undefined = "http://localhost:8787";
// let homeBaseUrl: string | undefined = "http://localhost:8787";
// let homeBaseUrl = "https://ai-worker.mjtdev.workers.dev";
// let homeBaseUrl = "https://ai-worker.intelligage.workers.dev";
let homeBaseUrl: string | undefined = __HOME_BASE__;
if (/intelligage/i.test(location.hostname)) {
homeBaseUrl = "https://ai-worker.intelligage.workers.dev";
}
Expand Down
9 changes: 9 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,18 @@ export default defineConfig({
define: {
__BUILD_TIMESTAMP__: JSON.stringify(new Date().toISOString()),
__APP_VERSION__: JSON.stringify("1.0.0"),

// Local dev settings
__HOME_BASE__: JSON.stringify("http://localhost:8787"),
__PAP_ID__: JSON.stringify(
"access-point-1725394696984-a760a179-851e-48d0-b276-85e7a426239c"
),

// Production settings
// __HOME_BASE__: JSON.stringify("https://ai-worker.intelligage.workers.dev"),
// __PAP_ID__: JSON.stringify(
// "access-point-1725571260862-23455f95-1253-4dfe-96e3-952ac6af647c"
// ),
__APP_FRONT__: JSON.stringify("pizza-demo"),
},
});

0 comments on commit a02cffa

Please sign in to comment.