This commit is contained in:
2025-09-21 13:00:10 +02:00
parent a26f8086f8
commit c2a1056db7
56 changed files with 339 additions and 104 deletions

43
main.py
View File

@@ -2,8 +2,8 @@ import logging
from datetime import datetime
from fastapi import Depends, FastAPI, HTTPException
from fastapi.responses import HTMLResponse, RedirectResponse
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import HTMLResponse, RedirectResponse
from sqlalchemy import text
from sqlalchemy.orm import Session
@@ -49,25 +49,27 @@ def health_check(db: Session = Depends(get_db)):
try:
# Test database connection
db.execute(text("SELECT 1"))
return {"status": "healthy",
"timestamp": datetime.utcnow(),
"message": f"{settings.project_name} v{settings.version}",
"docs": {
"swagger": "/docs",
"redoc": "/redoc",
"openapi": "/openapi.json",
"complete": "Documentation site URL here"
},
"features": [
"JWT Authentication",
"Marketplace-aware product import",
"Multi-shop product management",
"Stock management with location tracking",
],
"supported_marketplaces": [
"Letzshop",
],
"auth_required": "Most endpoints require Bearer token authentication", }
return {
"status": "healthy",
"timestamp": datetime.utcnow(),
"message": f"{settings.project_name} v{settings.version}",
"docs": {
"swagger": "/docs",
"redoc": "/redoc",
"openapi": "/openapi.json",
"complete": "Documentation site URL here",
},
"features": [
"JWT Authentication",
"Marketplace-aware product import",
"Multi-shop product management",
"Stock management with location tracking",
],
"supported_marketplaces": [
"Letzshop",
],
"auth_required": "Most endpoints require Bearer token authentication",
}
except Exception as e:
logger.error(f"Health check failed: {e}")
raise HTTPException(status_code=503, detail="Service unhealthy")
@@ -161,6 +163,7 @@ async def documentation_page():
</html>
"""
if __name__ == "__main__":
import uvicorn