crouter
PluginReference

Serving

Hosting a plugin behind an HTTP endpoint.

Exports of @north-light/crouter-plugin, read from the TypeScript compiler at build time. Types re-exported from @north-light/crouter-api are documented with that package.

createFetchHandler

function declared in serve.ts

Returns the request handler that serves the whole plugin: GET returns the install archive with an ETag (304 on a matching If-None-Match), and POST on a command's route decodes the input, runs its handler, and writes the JSON result or the NDJSON stream. A LeafError becomes its error envelope; any other exception becomes a 500 handler_failed.

(plugin: PluginDefinition, options?: FetchHandlerOptions) => (request: Request) => Promise<Response>

FetchHandlerOptions

interface declared in serve.ts

How the Fetch handler authenticates, advertises itself, and reports unhandled errors.

Prop

Type

On this page