41 lines
1.3 KiB
HTML
41 lines
1.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="pt-BR">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Health Check Ping</title>
|
|
<style>
|
|
body { font-family: sans-serif; max-width: 600px; margin: 80px auto; padding: 0 20px; }
|
|
h1 { font-size: 1.5rem; }
|
|
button {
|
|
background: #000; color: #fff; border: none;
|
|
padding: 10px 24px; border-radius: 6px; cursor: pointer; font-size: 1rem;
|
|
}
|
|
button:hover { background: #333; }
|
|
#result { margin-top: 20px; padding: 16px; background: #f4f4f4; border-radius: 6px; display: none; }
|
|
.ok { color: green; } .error { color: red; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Health Check Ping</h1>
|
|
<p>Clique no botão para enviar um ping ao Healthchecks.io.</p>
|
|
<button onclick="sendPing()">Enviar Ping</button>
|
|
<div id="result"></div>
|
|
|
|
<script>
|
|
async function sendPing() {
|
|
const el = document.getElementById('result');
|
|
el.style.display = 'block';
|
|
el.innerHTML = 'Enviando...';
|
|
try {
|
|
const res = await fetch('/api/ping');
|
|
const data = await res.json();
|
|
el.innerHTML = `<span class="${data.status}">${data.message}</span>`;
|
|
} catch (e) {
|
|
el.innerHTML = `<span class="error">Erro: ${e.message}</span>`;
|
|
}
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|