Commit a7cc6db44df3447cd2aaf58920f0aa25e476f235
Exists in
master
azus first commit
Showing 3 changed files Side-by-side Diff
routes/crime.js
View file @
a7cc6db
1 | +var unirest = require('unirest'); | |
2 | + | |
3 | +exports.view = function(req, res){ | |
4 | + | |
5 | + unirest.get("https://yourmapper2.p.mashape.com/datasetlist?format=json&maxlat=40&maxlon=-70&minlat=30&minlon=-90&num=5&sort=location") | |
6 | + .header("X-Mashape-Key", "gj4g6D3zxKmshys7yyf9KNbuywOxp1ueazFjsn6n2fK4sccIGA") | |
7 | + .header("Accept", "application/json") | |
8 | + .end(function (result) { | |
9 | + // console.log(result.status, result.headers, result.body); | |
10 | + | |
11 | + }); | |
12 | + | |
13 | + | |
14 | + | |
15 | + // These code snippets use an open-source library. http://unirest.io/nodejs | |
16 | + unirest.get("https://crimescore.p.mashape.com/crimescore?f=json&id=174&lat=38.08809&lon=-85.679626") | |
17 | + .header("X-Mashape-Key", "gj4g6D3zxKmshys7yyf9KNbuywOxp1ueazFjsn6n2fK4sccIGA") | |
18 | + .header("Accept", "application/json") | |
19 | + .end(function (result) { | |
20 | + res.render('pages/tempcrime', result); | |
21 | + }); | |
22 | + | |
23 | + | |
24 | +}; |
views/pages/landing.ejs
View file @
a7cc6db