FastAPI middleware for enabling maintenance mode
Project description
FastAPI Maintenance Mode Middleware
FastAPI Maintenance Mode Middleware is a Python package that provides middleware for enabling maintenance mode in FastAPI applications. When maintenance mode is enabled, all incoming requests will receive a 503 Service Unavailable response indicating that the service is temporarily unavailable due to maintenance.
Installation
You can install the package using pip
:
pip install fastapi-maintenance-mode
Example
from fastapi import FastAPI
from fastapi_maintenance_mode import MaintenanceModeMiddleware
app = FastAPI()
app.add_middleware(MaintenanceModeMiddleware, is_maintenance_mode=True)
@app.get("/")
async def root():
return {"status": "Ok"}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for fastapi-maintenance-mode-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | be0cb8e193b64956e69d8649e0ccf988eba64a8dc315900929b315d5afc63769 |
|
MD5 | 8db1501b5416cbc38e420d581e35f12f |
|
BLAKE2b-256 | b6e7183aa854fecd83a019de588f73f6c7aed5a3115f19872fb6a0de7fbf95b0 |
Close
Hashes for fastapi_maintenance_mode-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 979cc94feddf0448c0199f630011466f31a52859bf6148d4ccead0cd23575f46 |
|
MD5 | 15b8c4251130f5b64f2359f3a555401b |
|
BLAKE2b-256 | 5d47dc26017eab0b5a581c8a604a27e4900facbedc1ad4cc0a3af30f78c6e7e6 |