Files
roboto-promoto/lib/controllers/api.js
Fergal Moran d49dc8b3bf Initial Commit
2014-03-20 11:32:56 +00:00

19 lines
385 B
JavaScript

'use strict';
var mongoose = require('mongoose'),
Promotion = mongoose.model('Promotion'),
Thing = mongoose.model('Thing');
/**
* Get awesome things
*/
exports.awesomeThings = function(req, res) {
return Thing.find(function (err, things) {
if (!err) {
return res.json(things);
} else {
return res.send(err);
}
});
};