package documentation
A package responsible for, setup, booting, and shutting down the server.
| Module | legacy |
Provide endpoints that mimic the v2 API for OpenFlexure Connect discoverability. |
| Module | serve |
Add endpoints for static files to the underlying FastAPI server. |
From __init__.py:
| Function | customise |
Customise the server with additional endpoints, etc. |
| Function | serve |
Start the server from the command line. |
| Function | set |
Ensure a function is called before the shutdown. |
| Function | _get |
Read the config and return the scans directory. |
Ensure a function is called before the shutdown.
This monkey patches the Uvicorn Server's handle_exit. This is needed because the uvicorn lifecycle events and FastAPI shutdown events only fire once background tasks have completed.
Without this the system exits cleanly only if no client is receiving a StreamingResponse. This patch is used to stop the async generators that send streaming responses.
| Parameters | |
shutdownCallable[ | A callable with no arguments or outputs. This should stop any async generators that may be sending to streaming responses. |