Skip to content

Instantly share code, notes, and snippets.

@bogeychan
bogeychan / adapter.ts
Last active April 3, 2025 21:14
Basic Bun HTTP2 Adapter for ElysiaJS
// based on https://github.com/elysiajs/elysia/blob/main/src/adapter/bun/index.ts
import type { ElysiaAdapter, MaybePromise } from "elysia";
import { BunAdapter } from "elysia/adapter/bun";
import { isNumericString } from "elysia/utils";
import { ReadStream as NodeReadStream } from "node:fs";
import {
createSecureServer,
type Http2ServerRequest,