Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thlorenz/render-routes
Give it a routes object and it spits out html that you can load into your browser.
https://github.com/thlorenz/render-routes
Last synced: 13 days ago
JSON representation
Give it a routes object and it spits out html that you can load into your browser.
- Host: GitHub
- URL: https://github.com/thlorenz/render-routes
- Owner: thlorenz
- License: mit
- Created: 2013-08-07T15:37:43.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-08-07T19:40:47.000Z (over 11 years ago)
- Last Synced: 2024-12-10T08:25:36.666Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 195 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# render-routes [![build status](https://secure.travis-ci.org/thlorenz/render-routes.png)](http://travis-ci.org/thlorenz/render-routes)
Give it a routes object and it spits out html that you can load into your browser.
```js
var renderRoutes = require('render-routes');
var express = require('express');
var app = express();app.get('/routes', function (req, res) {
res.send(renderRoutes(app.routes));
});
```![screenshot](https://github.com/thlorenz/render-routes/raw/master/assets/screenshot.png)
## Installation
npm install render-routes
## API
```
/**
* Takes a routes hash and returns html to be displayed in your browser.
*
* @name exports
* @function
* @param allRoutes {Object} i.e. { get: [ { path: '/foo' }, { path: '/bar' } ], post: [ { '/foo' } ] }
* @return {String} html rendition of your routes
*/
```## License
MIT