Skip to content

Instantly share code, notes, and snippets.

@gelicia
Created September 28, 2013 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gelicia/6742884 to your computer and use it in GitHub Desktop.
Save gelicia/6742884 to your computer and use it in GitHub Desktop.
?
app.get('/api/inlet/:gistid', get_inlet)
function get_inlet(req, res, next){
res.header("Access-Control-Allow-Origin", "*");
var query = {
"gistid": req.params.gistid
, public: { $ne: false }
};
$inlets.find(query, {limit: 1}).toArray(function(err, inlets) {
if(err) res.send(err);
res.send(inlets);
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment