Serves the chat's history to the chatbox (ChatModal). Messages are sent, edited and deleted over the socket instead (routes/ws.ts).

  • GET /api/chat?limit=&before=&beforeId=&after=&afterId=, signed in. Returns messages oldest first, at most limit (50 by default, 100 at most). With no cursor, it returns the latest. With before, it returns the page just older than that cursor, for "load older". With after, it returns what follows it, for the resync after a reconnect. A cursor is a message's ISO created_at, and its id breaks ties. Without afterId, messages at the after timestamp itself are included.

Variables

v
default: Router

Mounted by api/main.ts behind the error, Open Graph and CORS middleware. An APIException thrown by a handler becomes the JSON error response there.