Last active
December 16, 2015 17:09
-
-
Save pfrazee/5467877 to your computer and use it in GitHub Desktop.
trying out another approach to routing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ROUTE(request, | |
{ head: 'get', put: 'set', patch: 'set', post:'postTo' }, | |
{ | |
service: '/', | |
products: '/products', | |
product: '/products/:pid', | |
session: '/session', | |
collection: '/:collection', | |
item: '/:collection/:item' | |
}, | |
{ | |
getService: function(request, response) { | |
}, | |
getProducts: function(request, response) { | |
}, | |
getProduct: function(request, response) { | |
}, | |
getSession: function(request, response) { | |
}, | |
setSession: function(request, response) { | |
}, | |
getCollection: function(request, response, cid) { | |
}, | |
postToCollection: function(request, response, cid) { | |
} | |
getItem: function(request, response, cid, iid) { | |
}, | |
setItem: function(request, response, cid, iid) { | |
}, | |
deleteItem: function(request, response, cid, iid) { | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment