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
123456789101112131415/** * Getting Bun Server Object for Bun adapters * @module */import type { Context } from 'hono'
/** * Get Bun Server Object from Context * @template T - The type of Bun Server * @param c Context * @returns Bun Server */export const getBunServer = <T>(c: Context): T | undefined => ('server' in c.env ? c.env.server : c.env) as T | undefined