Skip to content

Instantly share code, notes, and snippets.

@jrf0110
Forked from pfrazee/object-route-map.js
Last active December 16, 2015 17:09
Show Gist options
  • Save jrf0110/5468067 to your computer and use it in GitHub Desktop.
Save jrf0110/5468067 to your computer and use it in GitHub Desktop.
route({
'GET /': service.get,
'GET /session': session.get,
'SET /session': session.set,
'GET /products': products.list,
'GET /products/:pid': products.get,
'DEL /products/:pid': products.del
});
var service = {
get: function(request, response) { }
};
var session = {
get: function(request, response) { },
set: function(request, response) { }
};
var products = {
list: function(request, response) { }
get: function(request, response, pid) { }
del: function(request, response, pid) { }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment