Skip to content
Ivaylo Ivanov edited this page Jan 16, 2016 · 1 revision

The response object represents the HTTP response and it's using the Express.js response for a reference. Defined in Esrol-router - response.js. Currently, only few methods are implemented.

Status

Set the HTTP status for the response. It is a chainable alias of response.statusCode.

res.status(401).end();

Json

Sends a JSON response.

res.json({foo: 'bar'});

Redirect

Redirects to the specified URL with 302 HTTP status code.

res.redirect('http://example.com');

Clone this wiki locally