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"}
Release files for fastapi-maintenance-mode 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fastapi-maintenance-mode-1.0.0.tar.gz | 3.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fastapi_maintenance_mode-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.7 kB
Release files / fastapi-maintenance-mode-1.0.0.tar.gz
| Download URL | fastapi-maintenance-mode-1.0.0.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be0cb8e193b64956e69d8649e0ccf988eba64a8dc315900929b315d5afc63769
|
|
BLAKE2b-256 checksum How to use checksums |
b6e7183aa854fecd83a019de588f73f6c7aed5a3115f19872fb6a0de7fbf95b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.29.0 requests-toolbelt/0.10.1 urllib3/1.26.15 tqdm/4.65.0 importlib-metadata/6.0.1 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.11.0rc1
|
Release files / fastapi_maintenance_mode-1.0.0-py3-none-any.whl
| Download URL | fastapi_maintenance_mode-1.0.0-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
979cc94feddf0448c0199f630011466f31a52859bf6148d4ccead0cd23575f46
|
|
BLAKE2b-256 checksum How to use checksums |
5d47dc26017eab0b5a581c8a604a27e4900facbedc1ad4cc0a3af30f78c6e7e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.29.0 requests-toolbelt/0.10.1 urllib3/1.26.15 tqdm/4.65.0 importlib-metadata/6.0.1 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.11.0rc1
|