Return response as HTML:
response.send('HTML <br> here');
Return response as JSON:
response.json({foo: 'bar'});
// or
response.send({foo: 'bar'});
Return error response with a JSON payload:
response
.status(500)
.json({
error: 'message'
});
Return an empty response (i.e. no response body):
response
.status(401)
.end();