-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver.js
64 lines (55 loc) · 1.65 KB
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
var express = require('express');
var app = express();
var port = 3000;
var path = require('path');
app.use(express.static(__dirname + '/views'));
var crime = require('./app/crime');
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
var fedExData = {
"state": "Arizona",
"federalExpenses": {
"AmericanIndianEducation": "10,235 ",
"AssistanceInFederallyAffectedAreas": "149,281 ",
"BlockGrantForSchoolImprovement": "75,805 ",
"EnglishLanguageAcquisition": "14,128 ",
"GrantsForDisadvantaged": "342,030 ",
"RehabilitationServices": "65,364 ",
"SpecialEducation": "203,193 ",
"StudentFinancialAssistance": "1,312,501 "
}
};
var crimeData = {
"crimeData": {
"population": "164,008",
"Aggravated_Assault": "500",
"Arson": "28",
"Burglary": "1,579",
"Larceny_Theft": "6,804",
"Motor_vehicle_theft": "550",
"Murder": "5",
"Rape": "45",
"Robbery": "237"
}
};
var demoData = {
"educationData": {
"HighSchoolDiplomaOnlyPercentage": "24.4",
"BachelorDegreeOrHigherPercentage": "27.5",
"LessThanHighSchoolPercentage": "14"
}
};
// app.get('/crimedata/tempe/arizona', function(req, res) {
// res.send(crimeData);
// });
// app.get('/educationdata/arizona', function (req, res) {
// res.send(demoData);
// });
// app.get('/federalexpenses/arizona', function (req, res) {
// res.send(fedExData);
// });
app.use('/', crime);
app.listen(3000);