0.1.1 • Published 11 years ago

render-routes v0.1.1

Weekly downloads
5
License
-
Repository
github
Last release
11 years ago

render-routes build status

Give it a routes object and it spits out html that you can load into your browser.

var renderRoutes = require('render-routes');
var express = require('express');
var app = express();

app.get('/routes', function (req, res) {
  res.send(renderRoutes(app.routes));
});

screenshot

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