Dashboard › opencode › Lazy server-only HTTP construction
01a0aec3-9a63-7066-a19c-319749427bb7Defer server-only HTTP applications, routes, web handlers, service graphs, OpenAPI generation, and background startup until a process actually serves or requests them. CLI commands and scripts that merely import shared modules must incur no server setup cost or side effects. Use lazy memoized initialization so expensive construction occurs only on first use and is reused. In particular, build and serialize the OpenAPI /doc response only when requested, cache the complete HttpServerResponse, and reuse its serialized Uint8Array.