Commit a7cc6db44df3447cd2aaf58920f0aa25e476f235

Authored by Azusa Kawakami
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
... ... @@ -131,7 +131,7 @@
131 131 </div>
132 132  
133 133 <script>
134   - function emergeny(){
  134 + function emergency(){
135 135 var res = confirm("You are in a dangerous area. Would you like to call 911?");
136 136 if( res == true ) {
137 137 <a href="tel:+1-911">call 911</a>
views/pages/tempcrime.ejs View file @ a7cc6db
  1 +<!DOCTYPE html>
  2 +<html lang="en">
  3 + <head>
  4 + <% include ../partials/header %>
  5 + </head>
  6 +
  7 + <body>
  8 + <%= body %>
  9 + </body>
  10 +
  11 + </html>