Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.get('/:titless?', function(req, res) {
- PostDB.prototype.find({title: req.body.titless}, function(error, article_collection) {
- console.log(article_collection);
- console.log(error);
- switch (req.params.format) {
- case 'json':
- res.send(documents.map(function(d) {
- return { title: d.title, id: d._id };
- }));
- break;
- default:
- res.send('Format not available', 400);
- break;
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement