Skip to content

Instantly share code, notes, and snippets.

View kevireilly's full-sized avatar

Kevin Reilly kevireilly

  • California, USA
View GitHub Profile
function getOutput(requestID, _poolName) {
var url = SEARCH_URL + '/' + requestID + '/output';
request.get(url, function(err, response, body) {
if (err) {
console.error("Error requesting URL", url, err);
} else {
if (body) {
console.log("Writing json response to " + _poolName + ".json");
writeJSON(_poolname, body);
} else {
@kevireilly
kevireilly / app.js
Last active January 26, 2016 03:26 — forked from FredLoh/app.js
app.get("/api", function(req, res) {
if (req.query.lon === "" || req.query.lat === ""
|| req.query.lon = null || req.query.lat = null) { // handle undefined as well
res.sendStatus(404).json({ error: 'Latitude and longitude are required' });
} else {
console.log(req.query);
res.json(req.query);
}
});