createRouteRedirect
Overview
createRouteRedirect
(destinationURL, statusCode?): [`RouteRequestHandler`](../interfaces/RouteRequestHandler.mdx)
Parameters
Name | Type | Default value | Description |
---|---|---|---|
destinationURL | string | URL | undefined |
statusCode | ResponseRedirectStatus | 302 | Default Value 302 MOVED_TEMPORARILY |
Returns
The incoming request handler.
Creating a Worker that just redirects incoming requests.
const redirectToExample = new RedirectHandler('https://example.com')
export default redirectToExample
Defined in
router/functions/createRouteRedirect.ts:36
A route request handler for redirecting requests.