Skip to content

ExtraRouteHandler

type ExtraRouteHandler = (request, context) => Response | null | Promise<Response | null>;

Defined in: src/http/types.ts:249

A GET route contributed by a layer built on top of this one.

This exists so higher layers can own their own pages without this package having to know what they are. The VGI landing surface lives in @query-farm/vgi and arrives through here: @query-farm/vgi-rpc is generic RPC over Arrow and has no business shipping a page that renders catalogs, still less a compiled bundle of the client library that depends on it.

Ordering is the reason this is a hook rather than a wrapper around the returned handler. Contributed routes run after authentication and the OAuth browser redirect, so a page served here is as protected as the RPC surface; wrapping from outside would answer before either had a chance.

Parameter Type
request Request
context ExtraRouteContext

Response | null | Promise<Response | null>