Stores and serves the images pasted or dropped into the text editor, which
puts each one in the body as a link to its GET URL.
POST /api/attachments— signed in. Stores an image (multipartfile, at most 5 MB) and answers its id.GET /api/attachments/:attachmentId?w=&token=— public, but an image in a private dump or playlist, or in a comment on a private dump, needs its owner's mediatoken. Serves the image, scaled down tow(shared/image.ts) when it names one.
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/attachments.ts";