Skip to content

Commit

Permalink
Merge pull request #1215 from hackforla/make-middleware-factory
Browse files Browse the repository at this point in the history
Make middleware factory
  • Loading branch information
nichhk authored May 26, 2022
2 parents 0d726ed + c97b6eb commit 37f62d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/api/code/lacity_data_api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ def get_app():
app.include_router(reports.router, prefix="/reports")
app.include_router(shim.router, include_in_schema=DEBUG)

app.add_middleware(GZipMiddleware)
app_with_gzip = GZipMiddleware(app)

app.add_middleware(
CORSMiddleware,
app_with_cors = CORSMiddleware(
app_with_gzip,
allow_origins=API_ALLOWED_ORIGINS,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)

return app
return app_with_cors

0 comments on commit 37f62d9

Please sign in to comment.