Skip to content

Commit 3eb99b7

Browse files
authored
fix VITE_URL bug not getting set (#22)
1 parent 0582bc0 commit 3eb99b7

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

frontend/src/layouts/PageLayout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type Props = {
1010
};
1111
1212
const { title, description } = Astro.props;
13-
const apiUrl = import.meta.env.VITE_API_URL || 'https://api.swissai.svc.cscs.ch';
13+
const apiUrl = process.env.VITE_API_URL || 'https://api.swissai.svc.cscs.ch';
1414
---
1515

1616
<!doctype html>

frontend/src/lib/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ export function getApiUrl(): string {
44
if (typeof window !== 'undefined') {
55
return (window as any).__API_URL__ || DEFAULT_API_URL;
66
}
7-
return import.meta.env.VITE_API_URL || DEFAULT_API_URL;
7+
return process.env.VITE_API_URL || DEFAULT_API_URL;
88
}

frontend/src/pages/api_key.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if (isDev) {
2828
2929
// API key will be fetched client-side to avoid exposing it in the HTML
3030
let apiKey = "Loading...";
31-
const apiUrl = import.meta.env.VITE_API_URL || 'https://api.swissai.svc.cscs.ch';
31+
const apiUrl = process.env.VITE_API_URL || 'https://api.swissai.svc.cscs.ch';
3232
---
3333

3434
<PageLayout title="API Key" description="Your personal API key for accessing Research Computer services">

frontend/src/pages/leaderboard/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ let tokenData = {};
99
let error = null;
1010
1111
try {
12-
const response = await fetch(`${import.meta.env.VITE_API_URL || 'https://api.swissai.svc.cscs.ch'}/v1/metrics`, {
12+
const response = await fetch(`${process.env.VITE_API_URL || 'https://api.swissai.svc.cscs.ch'}/v1/metrics`, {
1313
method: "POST",
1414
headers: {
1515
"Content-Type": "application/json",

0 commit comments

Comments
 (0)