openmixer — generated API reference
    Preparing search index...

    Class RestRouter

    Maps HTTP onto a ResourceRegistry, and does nothing else.

    One per console, mounted by the host at RestRouterOptions.prefix. Stateless between requests: everything it answers with was read from the registry during the call.

    Index
    • get mountPath(): string

      The prefix this router answers under, normalised (leading slash, no trailing slash).

      Returns string

    • Every pair of registered templates that could match the same concrete path — an ambiguity a conformance test should assert is empty. Two templates matching one URL means a request has two possible entities, which is the duplicate-state defect wearing a URL.

      Returns readonly (readonly [string, string])[]

    • Serve one request.

      Never throws: a console that 500s because someone curled a bad path is a console that can be taken off the air from a laptop. Every failure is a status and a body.

      Parameters

      Returns Promise<RestResponse>

    • Whether this URL addresses the router ROOT — the console itself, the one address that is not an instance. GET there answers the index; a ?watch=1 there is the console-wide stream, so the host needs the same strip-and-compare resolve performs rather than a second opinion about what "the prefix, with or without its trailing slash" spells.

      Parameters

      • url: string

      Returns boolean

    • Which entity instance a URL addresses, or undefined when it addresses none.

      The ?watch=1 half of the front door needs the SAME resolution a GET performs — the law is that a stream emits exactly what GET on that URL returns, so anything that resolved a watch differently from a read would break it by construction. Exposed rather than duplicated for that reason, and it still names no entity.

      Parameters

      • url: string

      Returns RouteMatch | undefined