File size: 843 Bytes
714045e 28df1e8 | 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 | from fastapi import APIRouter, Depends
import datetime
from main import verify_token
router = APIRouter(tags=["system"])
@router.get("/")
async def root():
"""Root endpoint for uptime monitoring"""
return {"status": "online", "service": "hotel-image-api"}
@router.api_route("/health", methods=["GET", "HEAD"])
async def health_check():
"""Health check endpoint for uptime monitoring"""
return {"status": "healthy", "timestamp": datetime.datetime.utcnow().isoformat()}
@router.get("/status")
async def status():
"""Status check without token verification"""
return {"status": "running"}
@router.get("/token-test", dependencies=[Depends(verify_token)])
async def token_test():
"""Actually tests if token authentication is working"""
return {"status": "success", "message": "Token authentication successful"} |