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 (multipart file, at most 5 MB), sends user_updated to 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 to w (shared/image.ts) when it names one; 404 without one.

Variables

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.