mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: add gzip compression
This commit is contained in:
parent
6dbdfa5ba2
commit
768c270959
1 changed files with 6 additions and 0 deletions
6
app.py
6
app.py
|
|
@ -9,6 +9,8 @@ from fastapi.middleware.cors import CORSMiddleware
|
|||
from fastapi.responses import JSONResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from fastapi_jwt_auth.exceptions import AuthJWTException
|
||||
from fastapi.middleware.gzip import GZipMiddleware
|
||||
|
||||
# from src.services.mocks.initial import create_initial_data
|
||||
|
||||
########################
|
||||
|
|
@ -39,6 +41,10 @@ app.add_middleware(
|
|||
allow_headers=["*"]
|
||||
)
|
||||
|
||||
# Gzip Middleware (will add brotli later)
|
||||
app.add_middleware(GZipMiddleware, minimum_size=1000)
|
||||
|
||||
|
||||
# Static Files
|
||||
app.mount("/content", StaticFiles(directory="content"), name="content")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue