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()- Build one server app for a repository root
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
ServerConfigwhenconfigis omitted
- Returns:
Configured FastAPI application
- Return type:
fastapi.FastAPI
- Raises:
hubvault.optional.MissingOptionalDependencyError – Raised when the API extra is not installed.
TypeError – Raised when both
configand keyword overrides are supplied.
Example:
>>> from pathlib import Path >>> config = ServerConfig(repo_path=Path('repo'), token_rw=('rw',)) >>> callable(create_app) and isinstance(config.port, int) True