Have ideas to improve npm?Join in the discussion! »

    koa-body-res

    1.0.4 • Public • Published

    Format koa's respond json.

    Installation

    $ npm install koa-body-res

    Use with koa

    var app = require('koa')();
    var koaRes = require('koa-body-res');
    app.use(koaRes());
     
    this.data = 'This is a body';
    this.msg = 'This is a msg';
     
    output
     
    this.body = {
        code: 200,
        data: 'This is a body',
        msg: 'This is a msg'
    }
     

    作者官网: http://www.wemallshop.com

    Install

    npm i koa-body-res

    DownloadsWeekly Downloads

    7

    Version

    1.0.4

    License

    ISC

    Last publish

    Collaborators

    • avatar