express-redirector
v1.0.0
Published
Easily configure redirects with Express
Downloads
2
Readme
express-redirector
Easily configure redirects with Express
Table of Contents
Install
This project uses node and npm.
$ npm install express-redirector
$ # OR
$ yarn add express-redirector
Usage
const express = require('express')
const redirector = require('redirector')
const app = express()
app.get('/foo', (req, res) => {
res.status(200).send({Hi: true})
})
redirector(app, {
'/': '/foo',
'/bar': {
to: '/foo',
method: 'post',
status: 404
}
})
app.listen(3000)
Contribute
- Fork it and create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am "Add some feature"
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
License
MIT