tower-route

Tiny route component for client and server.

Tower Route

Tiny route component for client and server.

node.js:

$ npm install tower-route

browser:

$ component install tower/route
var route = require('tower-route');
 
route('/welcome', function(contextnext){
  context.render({ title: 'Hello World' });
});

Or with the action method:

route('/welcome')
  .action(function(contextnext){
    context.render({ title: 'Hello World' });
  });

You can also name them (makes it so you don't have to mess with url strings in code, to redirect/transition/etc.:

route('new-customer', '/welcome');

MIT