-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
executable file
·67 lines (49 loc) · 1.59 KB
/
index.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
65
66
67
var express = require('express');
var request = require('request');
var path = require('path');
var app = express();
app.set("views", path.resolve(__dirname, "views"));
app.set("view engine", "ejs");
app.use(express.static('public'));
app.listen(3000, function() {
console.log('Node luistert op poort 3000');
});
console.log("Webserver draait");
var datawebpunten;
request('https://geodata.antwerpen.be/arcgissql/rest/services/P_Portal/portal_publiek/MapServer/593/query?where=1%3D1&outFields=OBJECTID,NAAM,STRAATNAAM,HUISNUMMER,POSTCODE,DISTRICT,WEBSITE&outSR=4326&f=json',
function(error, response, body){
datawebpunten = JSON.parse(body);
for(var i=0; i < datawebpunten.features.length; i++) {
console.log(datawebpunten.features[i].attributes);
}
}
);
var datawifihotspots;
request('https://geodata.antwerpen.be/arcgissql/rest/services/P_Portal/portal_publiek/MapServer/60/query?where=1%3D1&outFields=OBJECTID,ID_WIFI,KLANT,LOCATIE,STRAAT,HUISNR,POSTCODE,GEMEENTE&outSR=4326&f=json',
function(error, response, body){
datawifihotspots = JSON.parse(body);
for(var i=0; i < datawifihotspots.features.length; i++) {
console.log(datawifihotspots.features[i].attributes);
}
}
);
app.get('/', function(req, res){
res.render('home', {
});
});
app.get('/all', function(req, res){
res.render('all', {
bibs: datawebpunten,
wifi: datawifihotspots
});
});
app.get('/bib', function(req, res){
res.render('bib', {
bibs: datawebpunten
});
});
app.get('/wifi', function(req, res){
res.render('wifi', {
wifi: datawifihotspots
});
});