Skip to content

startServer

function startServer(
port,
fetch,
options?
): Promise<RunningServer>;

Defined in: src/cli/index.ts:546

Serve a fetch handler under whatever runtime the CLI runs on: Bun.serve under Bun, a node:http server over the shared Node bridge under Node (multi-value headers, every Set-Cookie, streamed responses). Resolves once listening.

Parameter Type
port number
fetch FetchHandler
options? StartServerOptions

Promise<RunningServer>