express-middleware-redirector
TypeScript icon, indicating that this package has built-in type declarations

2022.12.0 • Public • Published

express-middleware-redirector

test-all

How to configure

minimum

All requests are redirect to same path on https://dest.example.com.

e.g.

  • / ▶️ https://dest.example.com/
  • /path/to/content-a ▶️ https://dest.example.com/path/to/content-a
  • ...
{
  "destination": {
    "baseUrl": "https://dest.example.com"
  }
}

More complex example

  • /pages/about-us ▶️ https://brand‐new.example.com/about
  • /pages/access and /pages/office-location ▶️ https://brand‐new.example.com/access
  • other all requests are redirect to https://brand‐new.example.com/news/we-have-moved
{
  "destination": {
    "baseUrl": "https://brand‐new.example.com",
    "fallbackPath": "/news/we-have-moved"
  },
  "contentMappings": [
    {
      "fromPath": "/pages/about-us",
      "toPath": "/about"
    },
    {
      "fromPath": ["/pages/access", "/pages/office-location"],
      "toPath": "/access"
    }
  ]
}

Readme

Keywords

Package Sidebar

Install

npm i express-middleware-redirector

Weekly Downloads

3

Version

2022.12.0

License

MIT

Unpacked Size

6.25 kB

Total Files

8

Last publish

Collaborators

  • mazgi