Skip to content

A module to have a FastAPI HealthCheck Reach out to a URI to validate exteral service health.

License

Notifications You must be signed in to change notification settings

jtom38/fastapi_healthcheck_uri

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fastapi_healthcheck_uri

A module to have a FastAPI HealthCheck reach out to a URI to validate external service health.

Adding Health Checks

Here is what you need to get started.

from fastapi import FastAPI
from fastapi_healthcheck import HealthCheckFactory, healthCheckRoute
from fastapi_healthcheck_uri import HealthCheckUri

app = FastAPI()

# Add Health Checks
_healthChecks = HealthCheckFactory()
_healthChecks.add(
    HealthCheckUri(
        alias='reddit', 
        connectionUri="https://www.reddit.com/r/aww.json", 
        tags=('external', 'reddit', 'aww'),
        healthyCode=200,
        unhealthyCode=500
    )
)
app.add_api_route('/health', endpoint=healthCheckRoute(factory=_healthChecks))

About

A module to have a FastAPI HealthCheck Reach out to a URI to validate exteral service health.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages