Spaces:
Sleeping

pegos-data / app /routers /base.py
Caner7's picture
Update app/routers/base.py
f8402d9 verified
Raw History Blame Contribute Delete
3.36 kB
from fastapi import APIRouter
from fastapi.responses import HTMLResponse
from app.core.hf_client import get_latest_timestamp
router = APIRouter()
@router.get("/", response_class=HTMLResponse)
def home():
updated = get_latest_timestamp()
return HTMLResponse(f"""
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>🚀 Pegos Data API</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
body {{
background: radial-gradient(circle at 20% 30%, #0d1b2a 0%, #000814 100%);
color: #f8f9fa;
font-family: 'Inter', sans-serif;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
text-align: center;
}}
h1 {{
font-size: 2.6rem;
margin-bottom: 0.3rem;
color: #80ffdb;
text-shadow: 0 0 10px rgba(128,255,219,0.4);
}}
p {{
color: #adb5bd;
font-size: 1.05rem;
}}
.updated {{
color: #dee2e6;
font-size: 0.95rem;
margin-top: 0.6rem;
}}
.grid {{
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 16px;
margin-top: 2rem;
}}
.card {{
background: rgba(255,255,255,0.05);
border: 1px solid rgba(255,255,255,0.1);
border-radius: 16px;
padding: 1rem 1.6rem;
transition: all 0.3s ease;
box-shadow: 0 0 12px rgba(0,0,0,0.4);
}}
.card:hover {{
transform: translateY(-4px);
box-shadow: 0 0 25px rgba(128,255,219,0.2);
border-color: #80ffdb;
}}
a {{
color: #80ffdb;
text-decoration: none;
font-weight: 600;
letter-spacing: 0.4px;
}}
a:hover {{
color: #48cae4;
}}
footer {{
position: absolute;
bottom: 12px;
font-size: 0.85rem;
color: #868e96;
}}
</style>
</head>
<body>
<h1>🚀 Pegos Data API</h1>
<p>HF flat dataset ile çalışan yapay zekâ destekli blockchain tahmin servisi</p>
<p class="updated"><strong>Son Güncelleme:</strong> {updated}</p>
<div class="grid">
<div class="card"><a href="/health">/health</a></div>
<div class="card"><a href="/latest">/latest</a></div>
<div class="card"><a href="/history">/history</a></div>
<div class="card"><a href="/predict">/predict</a></div>
<div class="card"><a href="/signal">/signal</a></div>
</div>
<footer>© 2025 Pegos AI | Built with ❤️ by Caner Giden</footer>
</body>
</html>
""")