fastapi-reloader API Reference
fastapi_reloader
¶
auto_refresh_middleware
module-attribute
¶
This middleware combines the two middlewares above to enable the full functionality of this package.
html_injection_middleware
module-attribute
¶
html_injection_middleware = UniversalMiddleware(
lambda app: BaseHTTPMiddleware(
app, _injection_http_middleware
)
)
This middleware injects the HMR client script into HTML responses.
reloader_route_middleware
module-attribute
¶
This middleware wraps the app with a FastAPI app that handles reload signals.
__all__
module-attribute
¶
send_reload_signal
¶
Broadcast a reload signal to all connected clients and break their long-polling connections.
patch_for_auto_reloading
¶
Source code in packages/fastapi-reloader/fastapi_reloader/patcher.py
core
¶
get_id
module-attribute
¶
requests
module-attribute
¶
reload_router
module-attribute
¶
send_reload_signal
¶
Broadcast a reload signal to all connected clients and break their long-polling connections.
heartbeat
async
¶
subscribe
async
¶
Source code in packages/fastapi-reloader/fastapi_reloader/core.py
patcher
¶
INJECTION
module-attribute
¶
FLAG
module-attribute
¶
T
module-attribute
¶
html_injection_middleware
module-attribute
¶
html_injection_middleware = UniversalMiddleware(
lambda app: BaseHTTPMiddleware(
app, _injection_http_middleware
)
)
This middleware injects the HMR client script into HTML responses.
reloader_route_middleware
module-attribute
¶
This middleware wraps the app with a FastAPI app that handles reload signals.
auto_refresh_middleware
module-attribute
¶
This middleware combines the two middlewares above to enable the full functionality of this package.
UniversalMiddleware
¶
Bases: ,
Adapt an ASGI middleware so it can serve both Starlette/FastAPI middleware slots and plain ASGI usage.
Source code in packages/fastapi-reloader/fastapi_reloader/patcher.py
is_streaming_response
¶
Source code in packages/fastapi-reloader/fastapi_reloader/patcher.py
_injection_http_middleware
async
¶
_injection_http_middleware(
request: Request,
call_next: Callable[[Request], Awaitable[Response]],
)