uvify / uvify_cors_wrapper.py
aviol's picture
Initial commit for uvify UI
d51321a
raw
history blame contribute delete
541 Bytes
#!/usr/bin/env python3
"""
CORS wrapper for uvify API
"""
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import uvify
# Get the original FastAPI app from uvify
app = uvify.api
# Add CORS middleware
app.add_middleware(
CORSMiddleware,
allow_origins=["http://localhost:5173", "http://localhost:5174", "http://localhost:5175"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8000)