index.spec.js
function parseMiddleware(ctx, next) {
      try {
        ctx.event = JSON.parse(ctx.content.toString());
        next();
      } catch (e) {
        throw e;
      }
    }
function parseMiddleware(ctx, next) {
      try {
        ctx.event = JSON.parse(ctx.content.toString());
        next();
      } catch (e) {
        throw e;
      }
    }
function parseMiddleware ( ctx , next ) { try { ctx . event = JSON . parse ( ctx . content . toString ( ) ) ; next ( ) ; } catch ( e ) { throw e ; } }
Parse JSON middleware

@param {String} msg
Parse JSON middleware