Custom mapper for earls.
npm install earls-function-mappervar mapper = require('earls-function-mapper').mapper;
var url = require('earls-function-mapper').url;
earls.register('f', mapper);
earls.f( function(){
url('products', '/products', function(){
url('show', '/show/:productid');
});
});The url property is optional if the name and url match and if you don't need arguments in your url. Like products in the example above.
var url = require('earls-function-mapper').url;
earls.f( function(){
url('products', function(){
url('show', '/show/:productid');
});
});This mapper works well with Coffee-Script to create concise maps.
url 'root', '/', ->
url 'products', ->
url 'new'
url 'create'
url 'edit'
url 'update', '/update/:productid'
url 'show', '/show/:productid'
url 'destroy'
Tests use mocha and should.
make unittests