-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
41 lines (27 loc) · 949 Bytes
/
index.js
File metadata and controls
41 lines (27 loc) · 949 Bytes
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
var http = require('http');
var server = http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.end("Hello World! Here we spin it up");
});
var port = 8080;
server.listen(port);
console.log("Server running at http://osc.ggdggdgdg.net/:%d", port);
var cron = require('node-cron');
cron.schedule('* * * * *', () => {
console.log('running a task every minute');
fetch('https://test--tst.test.com/services/rest/connect/v1.3/incidents/10654347', {
method: 'GET',
withCredentials: true,
credentials: 'include',
headers: {
'Authorization': 'Basic ZDBwMDEyaDpXYWxtYXJ0MQ=='
}
}).then(responseJson => {
var items = JSON.parse(responseJson._bodyInit);
console.log(responseJson);
})
.catch(error => this.setState({
isLoading: false,
message: 'Something bad happened ' + error
}));
});