WIP! A BB-style forum, on the ATmosphere! We're still working... we'll be back soon when we have something to show off!
node typescript hono htmx atproto
at 94bd8d44a4877d6d4d62f2abb471707f969e5469 12 lines 349 B view raw
1import { loadConfig } from "./config.js"; 2 3const config = loadConfig(); 4 5export async function fetchApi<T>(path: string): Promise<T> { 6 const url = `${config.appviewUrl}/api${path}`; 7 const res = await fetch(url); 8 if (!res.ok) { 9 throw new Error(`AppView API error: ${res.status} ${res.statusText}`); 10 } 11 return res.json() as Promise<T>; 12}