14 lines
419 B
JavaScript
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)}`;
|
|
},
|
|
};
|