Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'master' into master
  • Loading branch information
Kilo59 authored Sep 14, 2020
commit d66ce54d8cedf01d5813050dab9dc5972d05c244
28 changes: 1 addition & 27 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
import pydantic
import sentry_sdk
import uvicorn
from fastapi import FastAPI, Request, Response, openapi
from fastapi import FastAPI, Request, Response
from fastapi.middleware.cors import CORSMiddleware
from fastapi.middleware.gzip import GZipMiddleware
from fastapi.responses import JSONResponse
from fastapi.staticfiles import StaticFiles
from scout_apm.async_.starlette import ScoutMiddleware
from sentry_sdk.integrations.asgi import SentryAsgiMiddleware

Expand Down Expand Up @@ -113,31 +112,6 @@ async def handle_validation_error(
# Include routers.
APP.include_router(V1, prefix="", tags=["v1"])
APP.include_router(V2, prefix="/v2", tags=["v2"])
APP.mount("/static", StaticFiles(directory="static"), name="static")

# ##############
# Swagger/Redocs
# ##############


@APP.get("/", include_in_schema=False)
async def custom_swagger_ui_html():
"""Serve Swagger UI."""
return openapi.docs.get_swagger_ui_html(
openapi_url=APP.openapi_url,
title=f"{APP.title} - Swagger UI",
oauth2_redirect_url=APP.swagger_ui_oauth2_redirect_url,
swagger_js_url="/static/swagger-ui-bundle.js",
swagger_css_url="/static/swagger-ui.css",
)


@APP.get("/docs", include_in_schema=False)
async def redoc_html():
"""Serve ReDoc UI."""
return openapi.docs.get_redoc_html(
openapi_url=APP.openapi_url, title=f"{APP.title} - ReDoc", redoc_js_url="/static/redoc.standalone.js",
)


# Running of app.
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.