친구 작업중
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")
|
||||
|
||||
# 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(
|
||||
title="숙제노기 API",
|
||||
description="마비노기 모바일 숙제 관리용 백엔드 API",
|
||||
version="0.1.0",
|
||||
docs_url="/docs",
|
||||
docs_url=None,
|
||||
redoc_url=None,
|
||||
openapi_url="/openapi.json",
|
||||
root_path="/api"
|
||||
openapi_url=None
|
||||
)
|
||||
|
||||
# app = FastAPI(
|
||||
# docs_url=None,
|
||||
# redoc_url=None,
|
||||
# openapi_url=None
|
||||
# )
|
||||
#
|
||||
# @app.get("/docs", include_in_schema=False)
|
||||
# def custom_docs(user=Depends(get_current_user)):
|
||||
# return get_swagger_ui_html(openapi_url="/openapi.json", title="Sukjenogi API Docs")
|
||||
#
|
||||
# @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.get("/docs", include_in_schema=False)
|
||||
def custom_docs(user=Depends(get_current_user)):
|
||||
return get_swagger_ui_html(openapi_url="/openapi.json", title="Sukjenogi API Docs")
|
||||
|
||||
@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")
|
||||
async def log_exceptions_middleware(request: Request, call_next):
|
||||
@ -58,8 +58,8 @@ origins = [
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
# allow_origins=origins,
|
||||
allow_origins=["*"],
|
||||
allow_origins=origins,
|
||||
# allow_origins=["*"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user