Call
Defined in: src/server/router.ts:65
Per-request state handed to route handlers.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
Ctx |
- |
Grant |
never |
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
ctx |
Ctx |
The product’s context object (RouterOptions.context). |
src/server/router.ts:72 |
params |
Record<string, string> |
- | src/server/router.ts:69 |
path |
string |
The base-path-stripped path. | src/server/router.ts:68 |
principal |
Principal | null |
- | src/server/router.ts:73 |
query |
URLSearchParams |
- | src/server/router.ts:70 |
request |
Request |
- | src/server/router.ts:66 |
scoped |
Grant | null |
The scoped-token grant, or null for host principals and anonymous requests. |
src/server/router.ts:75 |
Methods
Section titled “Methods”body()
Section titled “body()”body<S>(schema): Promise<InferOutput<S>>;Defined in: src/server/router.ts:77
Parse + validate the JSON body (an empty body is {}). Memoized.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
S extends GenericSchema |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
schema |
S |
Returns
Section titled “Returns”Promise<InferOutput<S>>