Skip to content

Instantly share code, notes, and snippets.

@s3u
Created December 6, 2010 22:15
Show Gist options
  • Save s3u/731083 to your computer and use it in GitHub Desktop.
Save s3u/731083 to your computer and use it in GitHub Desktop.
var connect = require('connect');
var resource = require('resource-router');
function main(app) {
app.resource('/:id', {
'get' : function(req, res) {
...
},
'put' : function(req, res) {
...
},
'delete' : function(req, res) {
...
}
});
};
var server = connect.createServer();
server.use('/items', resource(main));
server.listen(3000);
console.log('Connect server listening on port 3000');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment