Stores and serves the users' avatars. The profile page uploads the avatar,
and the client's Avatar component loads it at the size it shows, with the
user's updatedAt as a cache-busting version.
PUT /api/me/avatar— signed in. Replaces the caller's avatar (multipartfile, at most 5 MB), sendsuser_updatedto everyone, and answers the caller's user. 400 for an account from another instance, whose avatar comes from there. The instances the caller signed in to are told.GET /api/users/:key/avatar?w=— public. Serves a user's avatar, scaled down tow(shared/image.ts) when it names one; 404 without 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/avatars.ts";