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