Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. 🫖 Status page with uptime monitoring & API monitoring as code 🫖 openstatus.dev
Something went wrong. Try again.
416 B · 17 lines
TypeScript
123456789101112131415161718import * as z from "zod";
const schema = z.object({ stargazers_count: z.number(),});
export async function getGitHubStars() { const res = await fetch( "https://api.github.com/repos/openstatusHQ/openstatus", { next: { revalidate: 600 } }, // 10min ); const json = await res.json(); const github = schema.safeParse(json);
if (!github.success) return 0; return github.data.stargazers_count;}