Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/layouts/PageLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type Props = {
};

const { title, description } = Astro.props;
const apiUrl = import.meta.env.VITE_API_URL || 'https://api.swissai.svc.cscs.ch';
const apiUrl = process.env.VITE_API_URL || 'https://api.swissai.svc.cscs.ch';
---

<!doctype html>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ export function getApiUrl(): string {
if (typeof window !== 'undefined') {
return (window as any).__API_URL__ || DEFAULT_API_URL;
}
return import.meta.env.VITE_API_URL || DEFAULT_API_URL;
return process.env.VITE_API_URL || DEFAULT_API_URL;
}
2 changes: 1 addition & 1 deletion frontend/src/pages/api_key.astro
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if (isDev) {

// API key will be fetched client-side to avoid exposing it in the HTML
let apiKey = "Loading...";
const apiUrl = import.meta.env.VITE_API_URL || 'https://api.swissai.svc.cscs.ch';
const apiUrl = process.env.VITE_API_URL || 'https://api.swissai.svc.cscs.ch';
---

<PageLayout title="API Key" description="Your personal API key for accessing Research Computer services">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/leaderboard/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let tokenData = {};
let error = null;

try {
const response = await fetch(`${import.meta.env.VITE_API_URL || 'https://api.swissai.svc.cscs.ch'}/v1/metrics`, {
const response = await fetch(`${process.env.VITE_API_URL || 'https://api.swissai.svc.cscs.ch'}/v1/metrics`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Expand Down
Loading