This module extends the koa-router with some features usable with oas.
🏠 Homepage
- Extends the normal
koa-router
. - Add routes on runtime from a oas-specification.
- Validates the oas (opt-out possible).
- Generates stubs for not implemented operations (opt-out possible).
npm i koa-oas-router --save
const KoaOasRouter = require('koa-oas-router');
const yamljs = require('yamljs');
const spec = yamljs.load('./oas.yaml');
const router = new KoaOasRouter.KoaOasRouter(opts);
router.addRoutesFromSpecification(spec);
import { KoaOasRouter } from 'koa-oas-router';
import * as yamljs from 'yamljs';
const spec = yamljs.load('./oas.yaml');
const router = new KoaOasRouter(opts);
router.addRoutesFromSpecification(spec);
For more detailed information look at the API.
npm run test
👤 Matthias Hecht
- Github: @matzehecht
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
Copyright © 2019 Matthias Hecht.
This project is MIT licensed.