Class RedirectingHttpHandler

Handler that redirects paths matching given patterns to their corresponding URL, substituting selected groups.




baseUrl: string

Base URL of the server.

logger: Logger = ...
redirects: {
    redirectPattern: string;
    regex: RegExp;

Type declaration

  • redirectPattern: string
  • regex: RegExp
responseWriter: ResponseWriter

To write the redirect to the response.

statusCode: 302 | 301 | 308 | 303 | 307 = 308

Desired 30x redirection code (defaults to 308).

targetExtractor: TargetExtractor

To extract the target from the request.


  • Checks whether the input can be handled by this class. If it cannot handle the input, rejects with an error explaining why.


    Returns Promise<void>

    A promise resolving if the input can be handled, rejecting with an Error if not.