mirror of
https://github.com/fastapi/fastapi.git
synced 2025-12-25 15:18:36 -05:00
12 lines
230 B
Python
12 lines
230 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.gzip import GZipMiddleware
|
|
|
|
app = FastAPI()
|
|
|
|
app.add_middleware(GZipMiddleware, minimum_size=1000, compresslevel=5)
|
|
|
|
|
|
@app.get("/")
|
|
async def main():
|
|
return "somebigcontent"
|