HTML / Text view of `Director.router` instances
JavaScript
Latest commit 74a089a Aug 19, 2012 @Marak Marak [dist] Bump to v0.2.0
Permalink
Failed to load latest commit information.
examples [dist] Added code May 30, 2012
lib [dist] Added code May 30, 2012
README.md [docs] Updating README Aug 19, 2012
package.json [dist] Bump to v0.2.0 Aug 19, 2012

README.md

director-explorer

HTML explorer interface for Director routers.

Features

  • Can currently output a plain-text view of a Director.Router instance

See Also:

Installation

 npm install director-explorer

Usage

var de       = require('director-explorer'),
    director = require('director');

var router = new director.http.Router();

// simple noop for demo
var n = function(){};

router.get('/', n);

router.path('/users/:id', function(){
  this.post(n);   
  this.get(n);    
  this.delete(n); 
  this.put(n);    
  this.path('/dongles', function(){
    this.get(n);
    this.post(n);
  })
})

console.log(de.table(router));

/* 

  OUTPUTS:

    GET     / 
    POST    /users/([._a-zA-Z0-9-]+) 
    GET     /users/([._a-zA-Z0-9-]+) 
    DELETE  /users/([._a-zA-Z0-9-]+) 
    PUT     /users/([._a-zA-Z0-9-]+) 
    GET     /users/([._a-zA-Z0-9-]+)/dongles 
    POST    /users/([._a-zA-Z0-9-]+)/dongles 

*/

TODO

  • Add HTML view with collapsable menus
  • Add WSDL view