Spaces:
Paused

meloon / app /main.py
isold's picture
Update app/main.py
fdb0baf verified
Raw History Blame Contribute Delete
679 Bytes
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import uvicorn
from app.core.config import settings
from app.api.api import api_router
app = FastAPI(
title=settings.PROJECT_NAME,
version=settings.PROJECT_VERSION,
openapi_url=f"/api/v1/openapi.json"
)
# Set all CORS enabled origins
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(api_router, prefix="/api/v1")
@app.get("/")
def root():
return {"message": "Welcome to MeloonChatBI API"}
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=7860)