koa-oas-router
TypeScript icon, indicating that this package has built-in type declarations

3.0.2 • Public • Published

Welcome to koa-oas-router 👋

Version Documentation Maintenance License: MIT semantic-release

This module extends the koa-router with some features usable with oas.

🏠 Homepage

Features

  • 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).

Install

npm i koa-oas-router --save

Usage

Javascript

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);

Typescript

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.

Docs

API

Run tests

npm run test

Author

👤 Matthias Hecht

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2019 Matthias Hecht.

This project is MIT licensed.

Readme

Keywords

Package Sidebar

Install

npm i koa-oas-router

Weekly Downloads

33

Version

3.0.2

License

MIT

Unpacked Size

37.8 kB

Total Files

14

Last publish

Collaborators

  • matzehecht