Created
January 26, 2016 03:09
-
-
Save FredLoh/49df75b3240fb1d3168d 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
app.get("/api?", function(req, res) { | |
var url_parts = url.parse(req.url, true); | |
var query = url_parts.query; | |
if (query.lon === "" || query.lat === "" || query.lon === null) { | |
res.sendStatus(404); | |
} | |
queryStuff = JSON.stringify(req.query); | |
console.log(req.query.lon); | |
res.end(queryStuff); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment