/
dashaaaa12234
/
team-project-practice
Обзор
Документация
Войти
/
dashaaaa12234
/
team-project-practice
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/http_server/static/index.html
26 строк
818 B
Богданова Дарья
Обновил HTTP-сервер: добавил API, логирование, обработку 404
23 май 2026, 18:43
23 май 2026, 18:43
115e3e7
Код
Авторство
О чём код?
<!DOCTYPE html> <html> <head><title>My HTTP Server</title> <style> body { font-family: Arial; text-align: center; margin-top: 50px; } button { padding: 10px 20px; margin: 10px; cursor: pointer; } #time { font-size: 24px; color: blue; } </style> </head> <body> <h1>HTTP Server is running!</h1> <p>This file is loaded from static/ folder</p> <button onclick="getTime()">Get Time</button> <p id="time"></p> <button onclick="location.href='/about'">About Server</button> <button onclick="location.href='/api/time'">API: Time</button> <script> async function getTime() { const res = await fetch('/api/time'); const data = await res.json(); document.getElementById('time').innerText = data.time; } </script> </body> </html>