RedirectHandler
Defined in: src/redirect.ts:111
The redirect handler.
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
core |
LinksCore |
- | src/redirect.ts:116 |
ingestor |
| ClickIngestor | null |
null when recording is disabled. |
src/redirect.ts:119 |
resolver |
Resolver |
- | src/redirect.ts:117 |
Methods
Section titled “Methods”close()
Section titled “close()”close(): Promise<void>;Defined in: src/redirect.ts:121
Flush pending clicks and counters, stop timers.
Returns
Section titled “Returns”Promise<void>
fetch()
Section titled “fetch()”fetch(request, ctx?): Promise<Response>;Defined in: src/redirect.ts:115
Like handle, but answers 404 instead of null.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
request |
Request |
ctx? |
RedirectContext |
Returns
Section titled “Returns”Promise<Response>
handle()
Section titled “handle()”handle(request, ctx?): Promise<Response | null>;Defined in: src/redirect.ts:113
Answer a short-link request, or null when it is not one. Never throws.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
request |
Request |
ctx? |
RedirectContext |
Returns
Section titled “Returns”Promise<Response | null>