Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

缩减你的 Koa 控制器代码:更优雅的 RESTful 函数库

$
0
0

使用一行代码帮助你完成大部分的 RESTful 状态回复,使代码更简单而标准。 类似于:

ctx.ok() ctx.badRequest(‘user miss’) ctx.notFound({ name: ‘router’ })

仓库在这里:koa-custom-response话说我还写了好多有意思的类库和工具,懒得一个个贴链接啦,有兴趣的可以来看看 DhyanaChina,想要加入到这个组织里一起贡献代码的也可以留 github 邮箱喔~~


Viewing all articles
Browse latest Browse all 14821

Trending Articles