Adapters
Deno
Run your h3 apps in Deno Deploy
You can directly host your h3 applications to Deno Deploy using Web Adapter.
Usage
Create app entry:
Create entry for Deno Deploy:
Create an import_map.json
:
Finally, use deno run
to locally preview:
To deploy, use deployctl deploy
:
WebSocket support
import wsAdapter from "crossws/adapters/deno";
const handler = toWebHandler(app)
const { handleUpgrade } = wsAdapter(app.websocket);
Deno.serve(request => {
if (request.headers.get("upgrade") === "websocket") {
return handleUpgrade(request);
}
return handler(request)
})
See pi0/h3-on-edge demo for a fully working example (deployment).