predirect
Simple http redirect method
Usage
var redirect = ;var http = ; http;
or with currying:
var predirect = ;var http = ; http;
API
redirect(req, res, url[, text])
Redirect to url
and respond with text
if the request method isn't HEAD
.
text
gets parsed by util.format
and defaults to -> %s
.
If you only pass req
and res
, this will return a function you can then
pass url
and text
to.
redirect(ctx, url[, text])
Pass a context with .req
and .res
, instead of two separate arguments.
Installation
With npm do:
$ npm install predirect
License
(MIT)