친구 작업중
This commit is contained in:
parent
93d92a0686
commit
72105cba26
50
app/main.py
50
app/main.py
@ -12,33 +12,33 @@ from app.api import user, auth, character, homework, character_homework, dashboa
|
|||||||
|
|
||||||
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/api/auth/login")
|
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/api/auth/login")
|
||||||
|
|
||||||
|
# app = FastAPI(
|
||||||
|
# title="숙제노기 API",
|
||||||
|
# description="마비노기 모바일 숙제 관리용 백엔드 API",
|
||||||
|
# version="0.1.0",
|
||||||
|
# docs_url="/docs",
|
||||||
|
# redoc_url=None,
|
||||||
|
# openapi_url="/openapi.json",
|
||||||
|
# root_path="/api"
|
||||||
|
# )
|
||||||
|
|
||||||
app = FastAPI(
|
app = FastAPI(
|
||||||
title="숙제노기 API",
|
docs_url=None,
|
||||||
description="마비노기 모바일 숙제 관리용 백엔드 API",
|
|
||||||
version="0.1.0",
|
|
||||||
docs_url="/docs",
|
|
||||||
redoc_url=None,
|
redoc_url=None,
|
||||||
openapi_url="/openapi.json",
|
openapi_url=None
|
||||||
root_path="/api"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# app = FastAPI(
|
@app.get("/docs", include_in_schema=False)
|
||||||
# docs_url=None,
|
def custom_docs(user=Depends(get_current_user)):
|
||||||
# redoc_url=None,
|
return get_swagger_ui_html(openapi_url="/openapi.json", title="Sukjenogi API Docs")
|
||||||
# openapi_url=None
|
|
||||||
# )
|
@app.get("/openapi.json", include_in_schema=False)
|
||||||
#
|
def custom_openapi(user=Depends(get_current_user)):
|
||||||
# @app.get("/docs", include_in_schema=False)
|
return get_openapi(
|
||||||
# def custom_docs(user=Depends(get_current_user)):
|
title="Sukjenogi API",
|
||||||
# return get_swagger_ui_html(openapi_url="/openapi.json", title="Sukjenogi API Docs")
|
version="0.2",
|
||||||
#
|
routes=app.routes
|
||||||
# @app.get("/openapi.json", include_in_schema=False)
|
)
|
||||||
# def custom_openapi(user=Depends(get_current_user)):
|
|
||||||
# return get_openapi(
|
|
||||||
# title="Sukjenogi API",
|
|
||||||
# version="0.2",
|
|
||||||
# routes=app.routes
|
|
||||||
# )
|
|
||||||
|
|
||||||
@app.middleware("http")
|
@app.middleware("http")
|
||||||
async def log_exceptions_middleware(request: Request, call_next):
|
async def log_exceptions_middleware(request: Request, call_next):
|
||||||
@ -58,8 +58,8 @@ origins = [
|
|||||||
|
|
||||||
app.add_middleware(
|
app.add_middleware(
|
||||||
CORSMiddleware,
|
CORSMiddleware,
|
||||||
# allow_origins=origins,
|
allow_origins=origins,
|
||||||
allow_origins=["*"],
|
# allow_origins=["*"],
|
||||||
allow_credentials=True,
|
allow_credentials=True,
|
||||||
allow_methods=["*"],
|
allow_methods=["*"],
|
||||||
allow_headers=["*"],
|
allow_headers=["*"],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user