How to use koa-is-json - 1 common examples

To help you get started, we’ve selected a few koa-is-json examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ShieldBattery / ShieldBattery / server / lib / security / json.js View on Github external
return async function secureJson(ctx, next) {
    await next()
    if (isJson(ctx.body)) {
      ctx.body = jsonPrefix + JSON.stringify(ctx.body)


check if a koa body should be interpreted as JSON

Latest version published 10 years ago

Package Health Score

53 / 100
Full package analysis

Popular koa-is-json functions

Similar packages