hubvault.server.app

FastAPI app factory for hubvault.server.

This module builds the embedded HTTP application shared by import-based startup, CLI startup, and ASGI factory deployment. Optional server dependencies are imported lazily so the base installation remains importable without the API extra.

The module contains:

create_app

hubvault.server.app.create_app(config: ServerConfig | None = None, **kwargs)[source]

Create one FastAPI app bound to a single repository root.

Parameters:
  • config (Optional[ServerConfig]) – Optional pre-built server configuration

  • kwargs (dict) – Keyword arguments used to build ServerConfig when config is omitted

Returns:

Configured FastAPI application

Return type:

fastapi.FastAPI

Raises:

Example:

>>> from pathlib import Path
>>> config = ServerConfig(repo_path=Path('repo'), token_rw=('rw',))
>>> callable(create_app) and isinstance(config.port, int)
True