On this page
Development-mode orchestrator: spawns Vite, polls for readiness, wraps the app with ViteDevProxy, runs the server, and stops Vite on exit.
#src.fastware.dev
#src.fastware.dev
Development mode combining Vite frontend dev server and fastware ASGI backend in a single command with hot reload and proxy routing.
#dev
def dev(target: str | Callable, *, vite_command: str='npm run dev', vite_port: int=5173, host: str | None=None, port: int | None=None, pid_path: Path | None=None, name: str='FASTWARE', pre_serve: Callable[[], None] | None=None, backend_prefixes: list[str] | None=None) -> NoneStart Vite dev server + fastware ASGI server for development.
Spawns Vite as a subprocess, waits for it to be ready, then starts the fastware server with ViteDevProxy middleware. All frontend requests are proxied to Vite (with HMR), API requests are handled by the fastware router. Kills Vite on shutdown.
backend_prefixes overrides which path prefixes route to the backend (both HTTP and WebSocket) instead of being proxied to Vite. When None, ViteDevProxy's default applies (["/events", "/ws"]), so the conventional /ws WebSocket reaches the backend out of the box.