mirror of https://github.com/tiangolo/fastapi.git
fix(tutorial006.py): fix tutorial file
This commit is contained in:
parent
b4cd1f2893
commit
f275e35699
|
|
@ -6,12 +6,9 @@ from fastapi.openapi.docs import (
|
|||
get_stoplight_elements_html,
|
||||
get_swagger_ui_oauth2_redirect_html,
|
||||
)
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
|
||||
app = FastAPI(stoplight_elements_url=None)
|
||||
|
||||
app.mount("/static", StaticFiles(directory="static"), name="static")
|
||||
|
||||
|
||||
@app.get(app.swagger_ui_oauth2_redirect_url, include_in_schema=False)
|
||||
async def swagger_ui_redirect():
|
||||
|
|
@ -23,8 +20,8 @@ async def elements_html():
|
|||
return get_stoplight_elements_html(
|
||||
openapi_url=app.openapi_url,
|
||||
title=app.title + " - Elements",
|
||||
stoplight_elements_js_url="/static/web-components.min.js",
|
||||
stoplight_elements_css_url="/static/styles.min.css",
|
||||
stoplight_elements_js_url="https://unpkg.com/@stoplight/elements/web-components.min.js",
|
||||
stoplight_elements_css_url="https://unpkg.com/@stoplight/elements/styles.min.css",
|
||||
stoplight_elements_favicon_url="https://fastapi.tiangolo.com/img/favicon.png",
|
||||
api_description_document="",
|
||||
base_path="",
|
||||
|
|
|
|||
Loading…
Reference in New Issue