DocuRAG / Api /src /main.py
abadesalex's picture
infraestructure and feature upload
57cab59
raw
history blame
674 Bytes
import uvicorn
from fastapi import APIRouter, FastAPI
from fastapi.middleware.cors import CORSMiddleware
from src.modules.uploadDocument.routes.uploadDocument_route import \
router as upload_file_routes
app = FastAPI()
origins = [
"http://localhost:8000",
"http://localhost:3000",
]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app_router = APIRouter(prefix="/api")
app_router.include_router(upload_file_routes, prefix="/upload", tags=["upload"])
@app_router.get("/")
async def root():
return {"message": "Hello World"}
app.include_router(app_router)