accomodation-info-api / api /routes /system_routes.py
garvitcpp's picture
Update api/routes/system_routes.py
714045e verified
raw
history blame contribute delete
843 Bytes
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"}