Update api/routes/system_routes.py
Browse files- api/routes/system_routes.py +24 -24
api/routes/system_routes.py
CHANGED
|
@@ -1,25 +1,25 @@
|
|
| 1 |
-
from fastapi import APIRouter, Depends
|
| 2 |
-
import datetime
|
| 3 |
-
from main import verify_token
|
| 4 |
-
|
| 5 |
-
router = APIRouter(tags=["system"])
|
| 6 |
-
|
| 7 |
-
@router.get("/")
|
| 8 |
-
async def root():
|
| 9 |
-
"""Root endpoint for uptime monitoring"""
|
| 10 |
-
return {"status": "online", "service": "hotel-image-api"}
|
| 11 |
-
|
| 12 |
-
@router.
|
| 13 |
-
async def health_check():
|
| 14 |
-
"""Health check endpoint for uptime monitoring"""
|
| 15 |
-
return {"status": "healthy", "timestamp": datetime.datetime.utcnow().isoformat()}
|
| 16 |
-
|
| 17 |
-
@router.get("/status")
|
| 18 |
-
async def status():
|
| 19 |
-
"""Status check without token verification"""
|
| 20 |
-
return {"status": "running"}
|
| 21 |
-
|
| 22 |
-
@router.get("/token-test", dependencies=[Depends(verify_token)])
|
| 23 |
-
async def token_test():
|
| 24 |
-
"""Actually tests if token authentication is working"""
|
| 25 |
return {"status": "success", "message": "Token authentication successful"}
|
|
|
|
| 1 |
+
from fastapi import APIRouter, Depends
|
| 2 |
+
import datetime
|
| 3 |
+
from main import verify_token
|
| 4 |
+
|
| 5 |
+
router = APIRouter(tags=["system"])
|
| 6 |
+
|
| 7 |
+
@router.get("/")
|
| 8 |
+
async def root():
|
| 9 |
+
"""Root endpoint for uptime monitoring"""
|
| 10 |
+
return {"status": "online", "service": "hotel-image-api"}
|
| 11 |
+
|
| 12 |
+
@router.api_route("/health", methods=["GET", "HEAD"])
|
| 13 |
+
async def health_check():
|
| 14 |
+
"""Health check endpoint for uptime monitoring"""
|
| 15 |
+
return {"status": "healthy", "timestamp": datetime.datetime.utcnow().isoformat()}
|
| 16 |
+
|
| 17 |
+
@router.get("/status")
|
| 18 |
+
async def status():
|
| 19 |
+
"""Status check without token verification"""
|
| 20 |
+
return {"status": "running"}
|
| 21 |
+
|
| 22 |
+
@router.get("/token-test", dependencies=[Depends(verify_token)])
|
| 23 |
+
async def token_test():
|
| 24 |
+
"""Actually tests if token authentication is working"""
|
| 25 |
return {"status": "success", "message": "Token authentication successful"}
|