Import
import { ssrForHttp } from "@typed/ui/HttpRouter";Signatures
export declare const ssrForHttp: {
<E, R>(input: Matcher<RenderEvent, E, R>): (router: HttpRouter) => SsrForHttpEffect<E, R>;
<E, R>(router: HttpRouter, input: Matcher<RenderEvent, E, R>): SsrForHttpEffect<E, R>;
};Why
Typed route matchers already describe decoding, guards, parent prefixes, and
render output. ssrForHttp installs that same model in Effect’s HttpRouter
and buffers one complete HTML document for runtimes that require a known body.
Ownership and lifetime
Registration adds GET routes to the supplied Effect HttpRouter. Each request creates request-local memory navigation and current-route services; the request Effect owns rendering and all finalizers. Buffered rendering must complete before the response is returned. Rendering HTML does not mount or hydrate a browser client.
Routing behavior
Matcher cases sharing a path are tried in their compiled order. Path params overwrite same-named query params. Decode/guard failures continue candidate selection; a matched renderer failure stays in the typed request error channel.
Examples
import { ssrForHttp } from "@typed/ui/HttpRouter"
import { Effect } from "effect"
import * as HttpRouter from "effect/unstable/http/HttpRouter"
import { Parse, match } from "@typed/router"
import { html } from "@typed/template"
const pages = match(Parse("/"), html`<h1>Home</h1>`)
const routes = Effect.gen(function* () {
const router = yield* HttpRouter.make
yield* ssrForHttp(router, pages)
return router
})Other public imports
These import paths expose the same declaration. Each page retains its own public name and signature.