express-api-drawer

Draw api map in express apps

Usage no npm install needed!

<script type="module">
  import expressApiDrawer from 'https://cdn.skypack.dev/express-api-drawer';
</script>

README

Welcome to express-api-drawer 👋

Version Twitter: tutanck

Draw api map in express app

Install

npm i express-api-drawer

Usage

Asume you have an express route map like this (see example here).

const verbose = true;

//express
const express = require('express');
const app = express();

const config = require('express-api-drawer');
config(app); // setup the draw function on app

const api = {
  '/users': {
    get: users.list,
    delete: users.delete,
    '/:uid': {
      get: users.get,
      '/pets': {
        get: pets.list,
        '/:pid': {
          delete: pets.delete
        }
      }
    }
  }
};


app.draw(api, verbose); // we can now draw the api

//start the server
app.listen(3000);
console.log('Express started on port 3000');

Author

👤 tutanck

🤝 Contributing

Contributions, issues and feature requests are welcome!
I recently fell in ❤️ with Supernova and issues!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!


This README was generated with ❤️ by readme-md-generator