from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from app.api.payments import router as payments_router from app.db.base import engine, Base # Create database tables Base.metadata.create_all(bind=engine) app = FastAPI( title="Stripe Payment Integration Service", description="A FastAPI service for handling Stripe payments", version="1.0.0", ) # Configure CORS app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) # Include routers app.include_router(payments_router, prefix="/api/v1") @app.get("/") async def root(): """Base endpoint with service information""" return { "title": "Stripe Payment Integration Service", "description": "A FastAPI service for handling Stripe payments", "version": "1.0.0", "documentation": "/docs", "health_check": "/health", } @app.get("/health") async def health_check(): """Health check endpoint""" return { "status": "healthy", "service": "stripe-payment-integration-service", "version": "1.0.0", }