We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6c96e6 commit 941e4afCopy full SHA for 941e4af
lib/api.py
@@ -5,6 +5,7 @@
5
from fastapi import FastAPI, Request, status
6
from fastapi.exceptions import RequestValidationError
7
from fastapi.middleware.cors import CORSMiddleware
8
+from fastapi.middleware.gzip import GZipMiddleware
9
from fastapi.openapi.utils import get_openapi
10
from fastapi.responses import RedirectResponse, JSONResponse
11
@@ -29,6 +30,9 @@
29
30
app.include_router(motor.router)
31
app.include_router(rocket.router)
32
33
+# Compress responses above 1KB
34
+app.add_middleware(GZipMiddleware, minimum_size=1000)
35
+
36
37
def custom_openapi():
38
if app.openapi_schema:
0 commit comments