peal.web.app.create_app

peal.web.app.create_app(jobs_root=None, start_worker=None)[source]

Build the FastAPI application of the web demo.

Creates the JobStore under jobs_root (plus an _uploads subfolder for not-yet-submitted uploads), optionally starts the background Worker thread that executes queued jobs, registers all routes listed in the module docstring and mounts /static.

Parameters:
  • jobs_root (str, optional) – Directory holding job directories. Defaults to _jobs_root().

  • start_worker (bool, optional) – Whether to start the worker thread. Defaults to True unless PEAL_WEB_NO_WORKER=1 is set.

Returns:

The application; app.state carries store, uploads_root and worker (None when no worker was started).

Return type:

fastapi.FastAPI