Serves and replaces file dumps' uploads, a sub-resource of their dump. The
players, viewers and download links of the frontend build the URL with
dumpFileUrl, and its edit page replaces the file.
GET /api/dumps/:dumpId/file?v=&token=— public; a private dump's file needs its poster's mediatoken. Serves the file, inline when that is safe and as a download otherwise, with byte ranges.PUT /api/dumps/:dumpId/file— signed in, as its poster or withdump:moderate. Replaces a file dump's upload and comment, and any of its title, slug, categories and visibility (multipart).
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/files.ts";