Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bolajiolajide/koii
A simple middleware for displaying routes in an express application
https://github.com/bolajiolajide/koii
express javascript middleware route routing
Last synced: about 2 months ago
JSON representation
A simple middleware for displaying routes in an express application
- Host: GitHub
- URL: https://github.com/bolajiolajide/koii
- Owner: BolajiOlajide
- License: mit
- Created: 2018-12-30T11:57:40.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2023-11-01T07:13:11.000Z (about 1 year ago)
- Last Synced: 2024-09-13T12:39:06.005Z (3 months ago)
- Topics: express, javascript, middleware, route, routing
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/koii
- Size: 1.65 MB
- Stars: 76
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# KOII
[![star this repo](http://githubbadges.com/star.svg?user=BolajiOlajide&repo=koii&style=flat)](https://github.com/BolajiOlajide/koii)
[![fork this repo](http://githubbadges.com/fork.svg?user=BolajiOlajide&repo=koii&style=flat)](https://github.com/BolajiOlajide/koii/fork)
[![npm](https://img.shields.io/npm/v/koii.svg)](https://www.npmjs.com/package/koii)
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=102)](https://github.com/ellerbrock/open-source-badge/)
[![Open Source Love](https://badges.frapsoft.com/os/mit/mit.svg?v=102)](https://github.com/ellerbrock/open-source-badge/)Koii is a simple ExpressJS middleware used to print all routes accessible in an application to the console on start.
![Koii is inspired by Jackie and the fish](images/koi.jpg)
## Install
```console
npm install koii
```## Usage
To use **Koii** simply add it as a middleware in your express application. To do that, you need to first import **Koii**.
This can be done with requireJS or the ES6 import statements as shown below:
```js
// we require this way because koii is currently exported as an esModule
const koii = require('koii');
```OR
```js
import koii from 'koii';
```Once this is done, you can add the middleware with the statement
```js
app.use(koii)
```An example can be found in [this github gist](https://gist.github.com/BolajiOlajide/7649c1f7205fe9b95bb011fe5ef89721).
Ensure you do this after all your route definitions, if not the middleware won't have access to the routes defined.Read more about Koii [here](https://medium.com/backticks-tildes/introducing-koii-d556657723c)
Inspired by [@danielb2](https://github.com/danielb2)'s [Blipp plugin](https://www.npmjs.com/package/blipp) for HapiJS