Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi-maintenance-mode-1.0.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

fastapi_maintenance_mode-1.0.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

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

Hashes for fastapi-maintenance-mode-1.0.0.tar.gz
Algorithm Hash digest
SHA256 be0cb8e193b64956e69d8649e0ccf988eba64a8dc315900929b315d5afc63769
MD5 8db1501b5416cbc38e420d581e35f12f
BLAKE2b-256 b6e7183aa854fecd83a019de588f73f6c7aed5a3115f19872fb6a0de7fbf95b0

See more details on using hashes here.

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

Hashes for fastapi_maintenance_mode-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 979cc94feddf0448c0199f630011466f31a52859bf6148d4ccead0cd23575f46
MD5 15b8c4251130f5b64f2359f3a555401b
BLAKE2b-256 5d47dc26017eab0b5a581c8a604a27e4900facbedc1ad4cc0a3af30f78c6e7e6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page