This repo contains examples of unjs/h3 integration with popular runtime platforms.
With h3 (>= 1.8) you can easily integrate your app with any runtime platform supporting Fetch API (Request => Response).
import { createApp, eventHandler, toWebHandler } from "h3"; // or "https://esm.sh/h3@1.8.0"
const app = createApp();
app.use(
"/",
eventHandler((event) => "H3 works on edge!"),
);
// (Request) => Promise<Response>
const webHandler = toWebHandler(app);
You can virtually return anything from an event handler including web ReadableStream and Response!
See ./src/index.ts for main application and each platform details in next section.
./src/cloudflare.tspnpm cloudflare:devpnpm cloudflare:deploy./src/deno.tspnpm deno:devpnpm deno:deploy --token <deploy_token> --project <project_id>./src/bun.tspnpm bun:dev./src/lagon.tspnpm lagon:devpnpm lagon:deploy./src/netlify./netlify.tomlpnpm netlify:devcorepack enablepnpm installpnpm devMIT - Pooya Parsa pooya@pi0.io