0.5 缩减重构
This commit is contained in:
+16
-16
@@ -1,12 +1,12 @@
|
||||
from typing import Dict, List, Set
|
||||
import os
|
||||
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
from app.config import settings
|
||||
from app.routers import api_router, root_router
|
||||
|
||||
|
||||
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")
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ allow_origins = [
|
||||
"http://127.0.0.1:3000",
|
||||
"http://127.0.0.1:3001",
|
||||
]
|
||||
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=allow_origins,
|
||||
@@ -43,11 +43,11 @@ app.add_middleware(
|
||||
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"}
|
||||
|
||||
app.include_router(root_router)
|
||||
app.include_router(api_router)
|
||||
|
||||
|
||||
@app.get("/")
|
||||
async def root() -> Dict[str, str]:
|
||||
return {"message": "Wolai backend stage0 up"}
|
||||
|
||||
Reference in New Issue
Block a user