-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.html
35 lines (33 loc) · 1.05 KB
/
app.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fetch Data from API</title>
</head>
<body>
Hello world
<div id="data-container"></div>
<script>
// Replace 'your_api_url' with the actual URL of your API
const apiUrl = 'http://192.168.20.13:3000/client-data/1007705046';
// Fetch data from the API
fetch(apiUrl)
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.text();
})
.then(data => {
// Handle the fetched data here
const dataContainer = document.getElementById('data-container');
dataContainer.innerText = data; // Set plain text content
})
.catch(error => {
// Handle errors here
console.error('Error:', error);
});
</script>
</body>
</html>