Serves the comments on dumps. Comments are broadcast over the WebSocket as they are posted, edited and deleted, to everyone, or to its poster alone for a private dump, whose comments 404 for anyone else.
GET /api/dumps/:dumpId/comments— optional sign-in. Answers every comment on a dump, oldest first.POST /api/dumps/:dumpId/comments— signed in. Posts a comment, replying toparentIdif given.PATCH /api/comments/:commentId— signed in, as its author or withcomment:moderate. Edits a comment.GET /api/comments/:commentId/likers?page=&limit=— optional sign-in. Answers a page of the users who like a comment.DELETE /api/comments/:commentId— signed in, as its author or withcomment:moderate. Deletes a comment, leaving its place in the thread.
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/comments.ts";