server.ts
This file
Path
adapters/bun/src/server.ts
14 lines · 355 bytes · TypeScript
Last changed by
feat(adapters): add @hono/bun as a workspace package (#5447)Yusuke Wadabefore adoptionfc2343d
History of this fileTake it
feat(adapters): add @hono/bun as a workspace package (#5447)Yusuke Wadabefore adoptionfc2343d
lines 1–14why, one step back1/**2 * Getting Bun Server Object for Bun adapters3 * @module4 */5import type { Context } from 'hono'67/**8 * Get Bun Server Object from Context9 * @template T - The type of Bun Server10 * @param c Context11 * @returns Bun Server12 */13export const getBunServer = <T>(c: Context): T | undefined =>14 ('server' in c.env ? c.env.server : c.env) as T | undefined