Skip to main content

server-core/http

packages/server/src/http

Purpose

HTTP server construction barrel.

Public surface

makeCoreHttpApp

Function
export function makeCoreHttpApp(options: CoreHttpAppOptions)
Build the core HTTP app. Composes the three always-on routes (/health, /ws) with the auth surface (/api/v1/auth/register) and wraps the router in CORS.
RouteMounted unlessMethodBodyStatus
/healthalwaysGET200 {status, connections}
/wsalwaysGETWS Upgrade101
/api/v1/auth/registerskipDefaultRegisterRoutePOSTRegister.params201 {agentId, apiKey}; 400/403/500
/api/v1/apps/registerskipDefaultRegisterRoutePOST{ manifest, inviteCode? }201 {appId, appKey}; 400/403/500
All bodied routes funnel through readValidatedBody for JSON
decode + Effect-Schema strict (excess-rejecting) decode. Invite-gate
checks use safeEqual
(constant-time) to compare inviteCode against
registrationSecret.

makeNodeHttpServer

Function
export function makeNodeHttpServer()

Files

  • node-http-server.ts
  • routes.ts