Redirecting middleware for express.js
Checks if the original URL is in the redirect data and redirects to the value if it is.
Returns: Function
Param | Type | Description |
---|---|---|
redirectData | String | Object |
Object or path to JSON file containing redirect data. |
Example
import redirectMiddleware from '@serferdinand2/express-middleware-redirect'
app.use(redirectMiddleware('./path/to/redirects.json'));