Server¶
Pyplet’s server runtime is built on top of Tornado and lives in the pyplet.server package:
pyplet.server.webwires the HTTP routes, static assets, WebSocket endpoints and application shell.pyplet.server.configexposes configuration values such as address, port, apps root and the Pyodide URL.
The pyplet start CLI command configures pyplet.server.config (via command-line flags and PYPLET_* environment variables) and then starts the Tornado application defined in pyplet.server.web.
At a high level:
- The home page lists micro apps discovered under the configured
appsroot. - Each app is served via a dedicated route that loads Pyodide, fetches the app bundle, and calls
pyplet.client.bootstrap. - WebSocket endpoints expose a minimal async API compatible with
pyplet.WebSocket, allowing apps to implementwebsocket_server_loopcoroutines for real-time communication.
Refer to the CLI and Micro Apps pages for details on configuration and app structure.