Files
twimg-backend/app/main.py
Logan Cusano d90a9c28ef fix cors
2025-07-13 21:09:12 -04:00

25 lines
772 B
Python

from fastapi import FastAPI
from .routers import auth, users, videos
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI(title="Video Voting App",
swagger_ui_parameters={"persistAuthorization": True})
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(auth.router, prefix="/auth", tags=["Authentication"])
app.include_router(users.router, prefix="/users", tags=["Users"])
app.include_router(videos.router, prefix="/videos", tags=["Videos"])
@app.get("/", tags=["Root"])
async def read_root():
"""
The root endpoint of the Video Voting API.
"""
return {"message": "Welcome to the Video Voting API!"}