-
Notifications
You must be signed in to change notification settings - Fork 0
Response
Luis Eduardo Brito edited this page Oct 12, 2013
·
3 revisions
The response is an adapter created to handle multiple different responses from the API Controllers but serving always as a single schema object, as in the example below:
{
"result": "success",
"code": 200,
"message": "user successfully logged in",
"timestamp": "2013-08-29T02:09:30.301Z"
}
You can call it using the Response Adapter located in /api/adapters/response.js
:
// render json
response(req, res).json({result: "success", message: "test"});
// render view
response(req, res).view("home", {title: "Home Page"});