1
0
Files
jecnarozvrh/viewer/lib/api.ts
jzitnik-dev e9ea35a064
All checks were successful
Remote Deploy / deploy (push) Successful in 36s
feat: Integrate
2026-02-12 18:08:15 +01:00

19 lines
394 B
TypeScript

import { SubstitutionData } from "./types";
export async function getData(): Promise<SubstitutionData | null> {
const apiUrl = process.env.API_URL || 'http://localhost:3000';
try {
const res = await fetch(`${apiUrl}/versioned/v3`, {
next: { revalidate: 60 },
});
if (!res.ok) {
return null;
}
return res.json();
} catch {
return null;
}
}