Skip to content

Allow using alternate sources of files #160

@LynnKirby

Description

@LynnKirby

It would be useful to abstract the filesystem API so that, for example, in-memory files can be served.

I have a proof-of-concept (or even solution?) at 6c87c36. It adds an fs property to the options which requires fs.stat and fs.createReadStream functions. Set the environment variable USE_MEMFS before running tests and the test will use memfs. memory-fs doesn't work because the fs.Stats objects it creates only has functions attached and not all of the usual properties.

Related: expressjs/serve-static#83

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions