File size: 612 Bytes
62d835c f126604 62d835c f275c80 62d835c f275c80 f126604 62d835c f126604 ac9926b f126604 62d835c 0f83542 62d835c 1e0df14 ac9926b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
import uvicorn
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from config import setup_app
from endpoints import router
# Create the FastAPI app
app = FastAPI(title="TxAgent API", version="2.6.0")
# Apply CORS middleware
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"]
)
# Include the router with endpoints
app.include_router(router)
# Setup the app (e.g., initialize globals, startup event)
setup_app(app)
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000) |