koas-spec-handler

0.7.0 • Public • Published

Koas Spec Handler

Koas spec handler exposes the Open API document as a JSON API call.

Installation

npm install koa koas-core koas-spec-handler

Usage

const Koa = require('koa');
const { koas } = require('koas-core');
const { specHandler } = require('koas-spec-handler');

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

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

Options

Koas spec handler accepts one single argument. This is a string that specifies on which URL the Open API document is exposed. By default, it is exposed on /api.json.

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i koas-spec-handler

    Weekly Downloads

    1,120

    Version

    0.7.0

    License

    MIT

    Unpacked Size

    2.63 kB

    Total Files

    4

    Last publish

    Collaborators

    • remcohaszing