import { Handlers, PageProps } from "$fresh/server.ts"; interface User { login: string; name: string; avatar_url: string; } export const handler: Handlers = { async GET(_, ctx) { const { username } = ctx.params; const resp = await fetch(`https://api.github.com/users/${username}`); if (resp.status === 404) { return ctx.render(null); } const user: User = await resp.json(); return ctx.render(user); }, }; export default function Page({ data }: PageProps) { if (!data) { return

User not found

; } return (

{data.name}

{data.login}

); }