[]previous and next page

ApiHandler

A handler of one HTTP method of an API route.

A handler of one HTTP method of an API route.

Import#

ts
import type { ApiHandler } from "@shadow-js/dusk/server";

Signature#

ts
type ApiHandler = (event: RequestEvent) => ApiResult | Promise<ApiResult>

Examples#

ts
export const GET: ApiHandler = (event) => json({ id: event.params.id });