Created
December 5, 2009 12:17
-
-
Save mikekelly/249663 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* | |
I want to be able to build a DSL for node.js so that I can define app routes for an HTTP interface like this: | |
*/ | |
{ | |
"/blog" : { | |
GET: function(request) { | |
// List blog posts | |
}, | |
POST: function(request) { | |
// Create blog post | |
} | |
}, | |
"/blog/:post" : { | |
GET: function(request) { | |
// Display :post | |
}, | |
PUT: function(request) { | |
// Update :post | |
} | |
DELETE: function(request) { | |
// Delete :post | |
} | |
}, | |
"/blog/:post/comments" : { | |
GET: function(request) { | |
// List comments for :post | |
}, | |
POST: function(request) { | |
// Add comment for :post | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment