Skip to content

Instantly share code, notes, and snippets.

@ashfurrow
Created October 9, 2013 22:44
Show Gist options
  • Save ashfurrow/6909808 to your computer and use it in GitHub Desktop.
Save ashfurrow/6909808 to your computer and use it in GitHub Desktop.
Issue = mongoose.model("Issue", {
identifier: String,
date: String,
url: String,
name: String,
thumbnailURL: String
});
function issues(request, response) {
response.setHeader('Content-Type', 'text/json');
Issue.find().sort('number').exec(function(error, items) {
if (error) {
response.send(403, {"status": "error", "error:": exception});
}
else {
response.send(200, {"issues": items});
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment