render-routes

0.1.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i render-routes

Weekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • thlorenz