Skip to content

Instantly share code, notes, and snippets.

View gkatsanos's full-sized avatar

George Katsanos gkatsanos

View GitHub Profile
@gkatsanos
gkatsanos / -
Created November 23, 2014 15:15
/**
* List of Messages
*/
var myCoords = [[[ 4.32, 50.84 ], [ 4.01, 50.1 ], [ 4.12, 50.84 ], [ 4.52, 51.84 ]]];
exports.list = function(req, res) { Message.find().where('location').within().geometry({ type: 'Polygon', coordinates: myCoords }).sort('-created').populate('user', 'displayName').exec(function(err, messages) {
if (err) {
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
} else {