api/routing

module:api/routing

Description:
  • Config based routing rewriting, can match the whole location or just the path

Source:
Example
api-routing-auth-^/app=/rup/app

api-routing-path-^/old/endpoint/=/new/@PATH1@

api-routing-path-docs\.host\.com/[a-z.]+/=/doc/view/@FILE@

api-routing-path-^/([a-z]+).html$=/viewer/@BASE@

Methods

(static) check(req, name) → {boolean}

Description:
Source:
Parameters:
Name Type Description
req Request
name string

config property with rules to use: path, auth

Returns:
Type Description
boolean

true if the url has been replaced