from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from app.api.v1.api import api_router from app.core.config import settings app = FastAPI( title="Crypto P2P Trading Platform", description="A peer-to-peer cryptocurrency trading platform similar to Binance P2P", version="1.0.0", openapi_url="/openapi.json", docs_url="/docs", redoc_url="/redoc" ) app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) app.include_router(api_router, prefix="/api/v1") @app.get("/") async def root(): return { "title": "Crypto P2P Trading Platform", "description": "A peer-to-peer cryptocurrency trading platform", "documentation": f"{settings.SERVER_HOST}/docs", "health_check": f"{settings.SERVER_HOST}/health", "version": "1.0.0" } @app.get("/health") async def health_check(): return { "status": "healthy", "service": "crypto-p2p-platform", "version": "1.0.0" } if __name__ == "__main__": import uvicorn uvicorn.run(app, host="0.0.0.0", port=8000)