yera.dev.server

HTTP server for the Yera UI and app streaming.

Runs a FastAPI application that exposes app and session APIs, and streams live app events to the UI via Server-Sent Events (SSE).

Typically started via yera dev, yera run <app-path>, or python -m yera.dev.

Symbols

class DevServer — Uvicorn-based development server for Yera apps.

DevServer

Inherits: Server

Uvicorn-based development server for Yera apps.

Hosts the FastAPI application used by the CLI and ASGI entrypoints, exposing app and session APIs and streaming live events to the UI via Server-Sent Events (SSE). Optionally serves the bundled static UI when dev_ui is False, or integrates with a separate Next.js dev server when dev_ui is True.

Methods

start — Start the server in a background thread and wait until it is listening.
stop — Stop the server and clean up all sessions.
__enter__ — Start the server when entering the context.
__exit__ — Stop the server when exiting the context.
build_api — Build the FastAPI application with SSE streaming endpoints.

DevServer.start

start() → None

Start the server in a background thread and wait until it is listening.

DevServer.stop

stop() → None

Stop the server and clean up all sessions.

DevServer.__enter__

__enter__() → DevServer

Start the server when entering the context.

DevServer.__exit__

__exit__(
    exc_type: object,
    exc_val: object,
    exc_tb: object,
) → None

Stop the server when exiting the context.

DevServer.build_api

build_api() → FastAPI

Build the FastAPI application with SSE streaming endpoints.

Returns

type: FastAPI

Configured FastAPI application