-
Notifications
You must be signed in to change notification settings - Fork 0
Response
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.
Set the HTTP status for the response. It is a chainable alias of response.statusCode.
res.status(401).end();Sends a JSON response.
res.json({foo: 'bar'});Redirects to the specified URL with 302 HTTP status code.
res.redirect('http://example.com');