Home Reference Source Test
import {RedirectServer} from 'nodejs-redirect/src/RedirectServer.js'
public class | source

RedirectServer

Express server that redirect all requests to a different URL

Constructor Summary

Public Constructor
public

constructor(to: string, chain: Boolean)

Creates an instance of RedirectServer

Member Summary

Public Members
public

Will chain the request path to the redirect url.

public

expressServer: Express

Express server

public

URl to redirect requests.

Method Summary

Public Methods
public

listen(port: Number)

Start the server on a port, start listening

Public Constructors

public constructor(to: string, chain: Boolean) source

Creates an instance of RedirectServer

Params:

NameTypeAttributeDescription
to string

URl to redirect requests.

chain Boolean
  • optional
  • default: false

Will chain the request path to the redirect url.

Public Members

public chain: boolean source

Will chain the request path to the redirect url.

public expressServer: Express source

Express server

public to: string source

URl to redirect requests.

Public Methods

public listen(port: Number) source

Start the server on a port, start listening

Params:

NameTypeAttributeDescription
port Number

Port for running the server