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 mostlimit(50 by default, 100 at most). With no cursor, it returns the latest. Withbefore, it returns the page just older than that cursor, for "load older". Withafter, it returns what follows it, for the resync after a reconnect. A cursor is a message's ISOcreated_at, and its id breaks ties. WithoutafterId, messages at theaftertimestamp itself are included.
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.
Usage
import * as mod from "api/routes/chat.ts";