基于Node.js开发的KoaHub.js的输出json到页面
koahub-body-res
koahub body res
Format koa's respond json.
Installation
$ npm install koahub-body-res
Use with koa
var app = require('koa')();
var koaRes = require('koahub-body-res');
app.use(koaRes());
this.data = 'This is a body';
this.msg = 'This is a msg';
this.go = 'This is a go url';
output
this.body = {
code: 200,
data: 'This is a body',
msg: 'This is a msg'
}
this.body = {
code: 200,
data: 'This is a body',
msg: 'This is a msg',
go: 'This is a go url'
};
官网:http://js.koahub.com
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号