Created
October 9, 2013 22:44
-
-
Save ashfurrow/6909808 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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