mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-17 18:36:21 +00:00
- delete page `tag`, `archive` - add page `friends` - implement page `about` *partially*
18 lines
389 B
TypeScript
18 lines
389 B
TypeScript
export async function fetchText(url: string, ttl: number = 600) {
|
|
const res = await fetch(url, {
|
|
next: {
|
|
revalidate: ttl
|
|
}
|
|
});
|
|
return await res.text();
|
|
}
|
|
|
|
export async function fetchJson(url: string, ttl: number = 600) {
|
|
const res = await fetch(url, {
|
|
next: {
|
|
revalidate: ttl
|
|
}
|
|
});
|
|
return await res.json();
|
|
}
|