import { Registry } from "./pkg/mod.ts"; import { Hono } from 'npm:hono@^4.8.3' const { SMALLWEB_DIR } = Deno.env.toObject() const registry = new Registry({ root: SMALLWEB_DIR }) const app = new Hono() app.use('*', async (c, next) => { const path = new URL(c.req.url).pathname.substring(1).split(/[@\/]/).shift() if (!/^(agents|websocket|registry)$/.test(path)) { return c.notFound() } await next() }) app.get('*', (c) => registry.fetch(c.req.raw)) export default app;