Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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