Expand description
HTTP handlers, grouped as Lichess’s API docs group them.
Modules§
- account
- Account, user and bot endpoints.
- app_
files - The Chess lab training app (
web/chess, built with its wasm engine), served as static files under/app/fromCHESS_APP_DIR. - challenges
- Challenge endpoints.
- fairplay
- Fair-play review (open-chess endpoints, not Lichess’s): the
queue of flagged games, a game’s reports, a player’s record, and
reviewers’ verdicts. Needs a token with
chess:fairplayheld by a manager or an admin. - feed
GET /api/feed: every game on the server as server-sent events, for sites and dashboards that follow it (esports-lab follows it for its ratings and pricing). No token needed; it shows what the public game streams show.- games
- Game export: PGN by default, JSON with
Accept: application/json. - lab
- open-chess additions to the Lichess API, used by the chess training app:
- oauth
- OAuth 2.0 with PKCE, as Lichess does it: no client registration (the
client_idis any name the app picks), S256 code challenges, and long-lived access tokens. - play
- Board API and Bot API game actions (the same handlers serve both; the matched path says which).
- streams
- NDJSON streams: a player’s event stream, a game’s board/bot stream and the public move stream.
- web
- Signing in to this server: its own accounts (a username and a
password), and, with
ESPORTS_LOGIN, “Sign in with the host site” (esports-lab). Both end in this server’s session cookie, which the OAuth consent page and the Account page (API tokens) use.
Functions§
- form
- A urlencoded body (missing or empty is fine: no fields).
- html_
escape - index
GET /: what this is. Browsers go to the training app when it’s installed.- line
- One NDJSON line.
- ndjson
- The response half of an NDJSON stream; a task writes lines into the sender and stops when sending fails (the client went away).
- ok