让 api 接口更合规范

This commit is contained in:
alsotang 2014-10-25 00:24:45 +08:00
parent e4f719a915
commit 02b6c72026
2 changed files with 3 additions and 3 deletions

View File

@ -37,7 +37,7 @@ var index = function (req, res, next) {
'good', 'top', 'author']);
});
res.send(topics);
res.send({data: topics});
});
});
};
@ -61,7 +61,7 @@ var show = function (req, res, next) {
reply = _.pick(reply, ['id', 'author', 'content', 'ups', 'create_at']);
return reply;
});
res.send(topic);
res.send({data: topic});
}));
};

View File

@ -45,7 +45,7 @@ var show = function (req, res, next) {
return topic;
});
res.send(user);
res.send({data: user});
});
}));
};