Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/segment-boneyard/redirect
Simple route redirects for express.
https://github.com/segment-boneyard/redirect
Last synced: about 7 hours ago
JSON representation
Simple route redirects for express.
- Host: GitHub
- URL: https://github.com/segment-boneyard/redirect
- Owner: segment-boneyard
- Created: 2013-10-30T05:50:40.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-10-30T05:52:21.000Z (about 11 years ago)
- Last Synced: 2024-04-09T16:31:14.500Z (7 months ago)
- Language: JavaScript
- Size: 109 KB
- Stars: 5
- Watchers: 39
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# redirect
Simple redirects for express.
## Installation
$ npm install segmentio/redirect
## Example
```js
var express = require('express');
var redirect = require('redirect');express()
.get('/login', login)
.get('/signin', redirect('/login'))
.listen(8000);
```## API
### redirect(path, options)
Generate a route function that redirects to `path`. The (optional) `options` default to:```js
{ status: 301 }
```## License
```
WWWWWW||WWWWWW
W W W||W W W
||
( OO )__________
/ | \
/o o| MIT \
\___/||_||__||_|| *
|| || || ||
_||_|| _||_||
(__|__|(__|__|
```