1.0.0 • Published 5 years ago
express-api-drawer v1.0.0
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
1.0.0
5 years ago