Skip to content

Commit

Permalink
Merge pull request #107 from Thymis-io/feat/gzip
Browse files Browse the repository at this point in the history
Add GZip Middleware
  • Loading branch information
MSchmoecker authored Oct 8, 2024
2 parents a4530b4 + a7ddecb commit 14a2b4f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controller/thymis_controller/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from alembic.script import ScriptDirectory
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi.middleware.gzip import GZipMiddleware
from sqlalchemy import engine_from_config
from thymis_controller.config import global_settings
from thymis_controller.database.base import Base
Expand Down Expand Up @@ -191,6 +192,8 @@ async def lifespan(app: FastAPI):
allow_headers=["*"],
)

app.add_middleware(GZipMiddleware, minimum_size=1000, compresslevel=5)

app.include_router(auth.router, prefix="/auth")
app.include_router(api.router, prefix="/api")
app.include_router(agent.router, prefix="/agent")
Expand Down

0 comments on commit 14a2b4f

Please sign in to comment.