koas-status-code

Koas status code automatically sets the response status code based on the success status code specified in the Open API object.

Usage no npm install needed!

<script type="module">
  import koasStatusCode from 'https://cdn.skypack.dev/koas-status-code';
</script>

README

Koas Spec Handler

Koas status code automatically sets the response status code based on the success status code specified in the Open API object.

Installation

npm install koa koas-core koas-status-code

Usage

const Koa = require('koa');
const { koas } = require('koas-core');
const { statusCode } = require('koas-status-code');

const api = require('./api.json');

const app = new Koa();
app.use(koas(api, [statusCode()]));