create_app#
- mobu.main.create_app(*, load_config=True, startup=None)#
Create the FastAPI application.
This is in a function rather than using a global variable (as is more typical for FastAPI) because some routing depends on configuration settings and we therefore want to recreate the application between tests.
- Parameters:
load_config (
bool, default:True) – If set toFalse, do not try to load the configuration. This is used primarily for OpenAPI schema generation, where constructing the app is required but the configuration won’t matter.startup (
Awaitable[None] |None, default:None) – Additional code to run during application startup, used by the test suite when running mobu in a separate process to test monkeyflocker.
- Return type:
FastAPI