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
File details
Details for the file fastapi-maintenance-mode-1.0.0.tar.gz
.
File metadata
- Download URL: fastapi-maintenance-mode-1.0.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be0cb8e193b64956e69d8649e0ccf988eba64a8dc315900929b315d5afc63769 |
|
MD5 | 8db1501b5416cbc38e420d581e35f12f |
|
BLAKE2b-256 | b6e7183aa854fecd83a019de588f73f6c7aed5a3115f19872fb6a0de7fbf95b0 |
File details
Details for the file fastapi_maintenance_mode-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: fastapi_maintenance_mode-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 979cc94feddf0448c0199f630011466f31a52859bf6148d4ccead0cd23575f46 |
|
MD5 | 15b8c4251130f5b64f2359f3a555401b |
|
BLAKE2b-256 | 5d47dc26017eab0b5a581c8a604a27e4900facbedc1ad4cc0a3af30f78c6e7e6 |