Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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 \
\___/||_||__||_|| *
|| || || ||
_||_|| _||_||
(__|__|(__|__|
```