Media / foldkit-media/server

handlers

function · packages/media/src/server/handlers.ts:60

function handlers(
  options?: Options,
): Layer.Layer<
  Service<'foldkit-media', 'images'>,
  never,
  Variants | Originals | Transformer
>

The handlers of MediaApi's one route. The path is decoded against the space; a variant kept is served as kept, and one the request already holds (If-None-Match) is a 304 before the store is read; otherwise the original is read, transformed, kept and served. Every answer, a refusal included, goes through headersFor, and a failure is never the original in the variant's place.