-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
39 lines (34 loc) · 1.09 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
// import axios from "axios";
var data = JSON.stringify({
"collection": "adherents",
"database": "niitouma",
"dataSource": "niitouma",
"projection": {
"_id": 1
}
});
var config = {
method: 'get',
url: 'https://eu-west-2.aws.data.mongodb-api.com/app/data-icxal/endpoint/data/v1/action/findOne',
headers: {
'Content-Type': 'application/json',
'Access-Control-Request-Headers': '*',
'api-key': 'CIq5LHirGrpTfEJtR2rxUVYHmJUq9MWtJmeWJ207LAE7MCwLbVntq7Gp9hwenZ1s',
},
};
fetch('https://data.mongodb-api.com/app/application-0-qlzlt/endpoint/data/v1/action/findOne',{
method: "get",
mode: "no-cors",
headers: {
'Content-Type': 'application/json',
'Access-Control-Request-Headers': '*',
'api-key': 'CIq5LHirGrpTfEJtR2rxUVYHmJUq9MWtJmeWJ207LAE7MCwLbVntq7Gp9hwenZ1s',
}
}).then(response => response.json())
// axios(config)
// .then(function (response) {
// console.log(JSON.stringify(response.data));
// })
// .catch(function (error) {
// console.log(error);
// });