* Register a route redirecting callers to a different URL. * * @example * ```ts * server.redirect('/explorer', '/explorer/'); * ``` * * @param fromPath - URL path of the redirect endpoint * @param toPathOrUrl - Location (URL path or full URL) where to redirect to. * If you
(
fromPath: string,
toPathOrUrl: string,
statusCode?: number,
)
| 769 | * defaults to 303 (See Other). |
| 770 | */ |
| 771 | redirect( |
| 772 | fromPath: string, |
| 773 | toPathOrUrl: string, |
| 774 | statusCode?: number, |
| 775 | ): Binding { |
| 776 | return this.route( |
| 777 | new RedirectRoute(fromPath, this._basePath + toPathOrUrl, statusCode), |
| 778 | ); |
| 779 | } |
| 780 | |
| 781 | /* |
| 782 | * Registry of external routes & static assets |
no test coverage detected