-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
46 lines (26 loc) · 907 Bytes
/
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
var request = require('request');
// var jquery = require('jQuery');
// var app = require('./server/server.js');
var app = require('./server/server.js');
// app.get('/', )
var port = process.env.PORT || 3000;
// console.log(jquery);
// jquery('.year').html("<div>Heeeeeey!!!!</div>");
app.listen(port);
var options = {
url: 'https://numbersapi.p.mashape.com/1492/year?fragment=true&json=true',
headers: {
"X-Mashape-Key": 'fO6LEPSj1Ymsha2VU0tZiKZoubJmp1SKQP1jsnSrLLFLQBFA6n',
Accept: 'application/json'
}
}
request.get(options, function(error, response, body){
body = JSON.parse(body);
// console.log(body);
// console.log(body.number);
// console.log(typeof body.number);
// module.exports = body;
// res.send(body);
// res.send('<p>' + body.text + '</p>');
// $('.year').html("<div>Heeeeeey!!!!</div>");
})