npm.io
4.2.1 • Published 1 week ago

@walkeros/server-transformer-file

Licence
MIT
Version
4.2.1
Deps
1
Size
39 kB
Vulns
0
Weekly
365
Stars
342

walkerOS

@walkeros/server-transformer-file

Serves static files in walkerOS server flows from a pluggable store backend, deriving Content-Type from the file extension and responding directly.

DocumentationNPM PackageSource Code

Installation

npm install @walkeros/server-transformer-file

Quick start

import { startFlow } from '@walkeros/collector';
import { transformerFile } from '@walkeros/server-transformer-file';

await startFlow({
  transformers: {
    file: {
      code: transformerFile,
      config: {
        settings: {
          prefix: '/static',
          headers: { 'Cache-Control': 'public, max-age=3600' },
        },
      },
      env: { store: fileStore },
    },
  },
});

Documentation

Full configuration, mapping, and examples live in the docs: https://www.walkeros.io/docs/transformers/file

Contribute

Feel free to contribute by submitting an issue, starting a discussion, or getting in contact.

License

MIT

Keywords