32 lines
724 B
Python
32 lines
724 B
Python
from typing import Dict
|
|
|
|
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from app.config import settings
|
|
from app.routers import api_router, root_router
|
|
|
|
app = FastAPI(title="Wolai Backend", version="0.1.0-stage0")
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=[
|
|
settings.frontend_url,
|
|
"http://localhost:3000",
|
|
"http://localhost:3001",
|
|
"http://127.0.0.1:3000",
|
|
"http://127.0.0.1:3001",
|
|
],
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
app.include_router(root_router)
|
|
app.include_router(api_router)
|
|
|
|
|
|
@app.get("/")
|
|
async def root() -> Dict[str, str]:
|
|
return {"message": "Wolai backend stage0 up"}
|