Files
dashfront/src/api/thumb.js
2026-10-10 00:39:23 +02:00

14 lines
419 B
JavaScript

/**
* Content-addressed thumb AVIF by fullHash (8-char alphanumeric, see dashback pic.js).
* Auth: session cookie. Browser-cacheable (private, immutable, ETag).
*/
export const thumb = {
/**
* GET /api/thumb/:fullHash → image/avif (thumb bytes)
* Use as <img src={thumb.url(fullHash)} /> (same-origin; cookies sent).
*/
url(fullHash) {
return `/api/thumb/${encodeURIComponent(fullHash)}`;
},
};