-
-
Notifications
You must be signed in to change notification settings - Fork 61
/
migrate.js
45 lines (40 loc) · 1 KB
/
migrate.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
const { default: axios } = require('axios');
const https = require('https');
const vaxlogkey = `ZWh8jnnyrX5tBHQwlVJL23Q8IojEfQRQ9uz1qGmf`;
let url = 'https://prya4emvub.execute-api.us-east-1.amazonaws.com/api';
const log = (data) => {
let opts = {
headers: {
'x-api-key': vaxlogkey,
},
};
axios.post(url, data, opts).then(response=>{
console.log('post', response);
}).catch(err=>{
console.info(err);
})
}
let logItem = {
type: String,
count: Number,
date: Date,
vaccine: String,
location: String,
centerName: String,
beneficiaries: Array,
build: String,
};
let headers = {
"X-Rollbar-Access-Token": "143e39ee71ce45aeb6af216d334e1cc0"
}
const transRbItem = (item) => {
let obj = {};
return obj;
}
axios.get('https://api.rollbar.com/api/1/items', {headers})
.then(response => {
console.log('data', response.data.page, response.data.total_count);
console.log(JSON.stringify(response.data.result.items[0]))
}).catch(err=>{
console.log(err);
})