Advertisement
Guest User

Untitled

a guest
Jun 1st, 2012
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. app.get('/:titless?', function(req, res) {
  2.     PostDB.prototype.find({title: req.body.titless}, function(error, article_collection) {
  3. console.log(article_collection);
  4. console.log(error);
  5. switch (req.params.format) {
  6.       case 'json':
  7.         res.send(documents.map(function(d) {
  8.           return { title: d.title, id: d._id };
  9.         }));
  10.       break;
  11. default:
  12.         res.send('Format not available', 400);
  13.       break;
  14. }
  15.   });
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement