-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
33 lines (31 loc) · 889 Bytes
/
index.html
File metadata and controls
33 lines (31 loc) · 889 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
<!DOCTYPE html>
<html>
<head>
<title>ikARos</title>
</head>
<body>
<h2>Welcome</h2>
</body>
<script>
setInterval(() => {navigator.geolocation.getCurrentPosition(sendPosition);}, 4000);
function sendPosition(position) {
const lat = position.coords.latitude;
const lon = position.coords.longitude;
const data = {
lat,
lon
}
console.log(data);
fetch("https://ikaros-server.herokuapp.com/send", {
method: 'POST',
body: JSON.stringify(data),
headers: {"Content-Type": "application/json"}
})
.then(response => {
if (response.status !== 200) {
console.log('Error');
}
})
}
</script>
</html>