Skip to content

Commit

Permalink
Merge pull request #392 from BaiMoHan/main
Browse files Browse the repository at this point in the history
feat: add gzip middleware for response compression
  • Loading branch information
mrhan1993 authored Aug 6, 2024
2 parents e3ad26a + 9ca917d commit 90bc3b6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fooocusapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from fastapi.middleware.cors import CORSMiddleware
from fastapi.middleware.gzip import GZipMiddleware

import uvicorn

Expand All @@ -15,6 +16,7 @@

app = FastAPI()

app.add_middleware(GZipMiddleware, minimum_size=1000)
app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # Allow access from all sources
Expand Down

0 comments on commit 90bc3b6

Please sign in to comment.