-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
74 lines (69 loc) · 2.39 KB
/
Copy pathtest.html
File metadata and controls
74 lines (69 loc) · 2.39 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GameStore - Test</title>
<style>
body {
font-family: Arial, sans-serif;
background: #0f172a;
color: white;
padding: 2rem;
}
.card {
background: #1e293b;
padding: 1rem;
border-radius: 8px;
margin: 1rem 0;
border: 1px solid #334155;
}
.button {
background: #6366f1;
color: white;
padding: 0.5rem 1rem;
border: none;
border-radius: 6px;
cursor: pointer;
}
</style>
</head>
<body>
<h1>🎮 GameStore - Working!</h1>
<p>Se vedi questa pagina, significa che il setup sta funzionando!</p>
<div class="card">
<h2>Backend Status</h2>
<p>✅ Server API: <a href="http://localhost:5000" target="_blank">http://localhost:5000</a></p>
<p>✅ Games API: <a href="http://localhost:5000/api/games" target="_blank">http://localhost:5000/api/games</a></p>
</div>
<div class="card">
<h2>Test API</h2>
<button class="button" onclick="testAPI()">Test Games API</button>
<div id="result" style="margin-top: 1rem;"></div>
</div>
<script>
async function testAPI() {
const resultDiv = document.getElementById('result');
resultDiv.innerHTML = 'Loading...';
try {
const response = await fetch('http://localhost:5000/api/games');
const data = await response.json();
if (data.success) {
resultDiv.innerHTML = `
<h3>✅ API Working! Found ${data.data.games.length} games:</h3>
<ul>
${data.data.games.map(game => `
<li><strong>${game.title}</strong> - $${game.price}</li>
`).join('')}
</ul>
`;
} else {
resultDiv.innerHTML = '❌ API Error: ' + data.message;
}
} catch (error) {
resultDiv.innerHTML = '❌ Connection Error: ' + error.message;
}
}
</script>
</body>
</html>