-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
48 lines (39 loc) · 1012 Bytes
/
index.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
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login Page</title>
</head>
<body>
<h1>Welcome to the Login Page</h1>
<button onclick="redirectToLogin()">Login</button>
<button onclick="getLists()">getLists</button>
<script>
function redirectToLogin() {
// Redirect to the "/login" endpoint when the login button is clicked
window.location.href = "/login";
}
async function getLists() {
try {
const response = await fetch('/list/all', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
// Add any additional headers as needed
},
});
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
const data = await response.json();
console.log('Lists:', data);
return data;
} catch (error) {
console.error('Error fetching data:', error);
throw error;
}
}
</script>
</body>
</html>