(id: string)
| 3 | import type { IDResponse } from './types'; |
| 4 | |
| 5 | export const getMetadata = async (id: string) => { |
| 6 | const resp = await fetch(`https://api.fontsource.org/v1/fonts/${id}`); |
| 7 | |
| 8 | if (!resp.ok) { |
| 9 | throw new StatusError(resp.status, `Unable to fetch metadata for ${id}.`); |
| 10 | } |
| 11 | |
| 12 | return await resp.json<IDResponse>(); |
| 13 | }; |
| 14 | |
| 15 | export const verifyAuth = (req: Request) => { |
| 16 | const authHeader = req.headers.get('Authorization'); |