Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ritch
Created June 8, 2011 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ritch/1015329 to your computer and use it in GitHub Desktop.
Save ritch/1015329 to your computer and use it in GitHub Desktop.
var hive = require('hive');
var view = hive.view;
var redirect = hive.redirect;
var Task = hive.models.Task;
var Tasks = hive.queries.Tasks;
hive
.at('/todo')
.find('/all', Tasks)
.get('/mine', function(req, res) {
return new Tasks({onwer: req.session.id});
})
.post('/new', function(req, res) {
var model = new Task({owner: req.session.id});
return model.save();
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment