feat: Added viewer
This commit is contained in:
17
viewer/lib/api.ts
Normal file
17
viewer/lib/api.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user