ADR 0010: @arachnejs/server — Bun HTTP kernel
- Status: Accepted
- Date: 2026-09-28
- Deciders: Arachne core
Context #
Client routing landed in @arachnejs/router. Apps still need a server that can
match the same path language, speak Request/Response, and boot under Bun
without pulling in Express/Hono as the public API.
Decision #
@arachnejs/serverwrapsBun.servewith a small route table:{ method, path, handler }, plus optional middleware and a fallback handler (SPA / 404).- Path matching reuses
compilePathfrom@arachnejs/routerso:param/*restmean the same on client and server. - Handlers receive a Context (
request,params,query,url) and return a WebResponse. Helpers:json,text,html. createServerreturns{ fetch, listen, stop }—fetchis testable without binding a port;listenstarts Bun.- Depends on
router,render,core,config,mcp(layer map). Phase 0 usesrouter+mcp(+ optionalcorelater for request-scoped DI).
Alternatives considered #
- Export Hono / Elysia as Arachne — rejected; wrong boundary.
- Defer server until after DB — blocks end-to-end demos.
Consequences #
- Playground can migrate onto
@arachnejs/server. - Future SSR will plug
renderToStringinto route handlers.