@imnotjames/koa-openapi-router
v0.0.2
Published
An OpenAPI Router for Koa
Downloads
2
Readme
Koa OpenAPI Router
Creates a Koa Router from an OpenAPI document via the OpenAPI Framework Package.
This sets up the routes, body parsing, request validation, response validation, security, and default parameters.
Installation
Install using npm or [yarn][yarn]
# npm
npm install @imnotjames/koa-openapi-router
# yarn
yarn add @imnotjames/koa-openapi-router
Getting Started
WIP
Start with an OpenAPI Document
Create Operations - similar to standard koa middleware
Define the application.
const app = new Koa();
const router = getRouter({ apiDoc, operations });
app
.use(router.routes())
.use(router.allowedMethods());
app.listen(8080);