Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable use with memory-fs #83

Open
gajus opened this issue Mar 4, 2017 · 4 comments
Open

Enable use with memory-fs #83

gajus opened this issue Mar 4, 2017 · 4 comments
Assignees

Comments

@gajus
Copy link

gajus commented Mar 4, 2017

I am producing all the files and storing them only in memory, i.e. https://github.com/webpack/memory-fs. I'd like there to be an option to tell serve-static which fs to use.

@dougwilson
Copy link
Contributor

Does that module actually implement enough of the features to work here? I didn't look at it immediately but I remember at least one previous issue about this. Of course, please feel so inclined to make a PR in which you think the ideal implementation should be. This module does not require(fs) anywhere, so the change here is not obvious to me.

@gajus
Copy link
Author

gajus commented Mar 4, 2017

This module does not require(fs) anywhere, so the change here is not obvious to me.

serve-static is using send to read-stream files.

var stream = send(req, path, opts)

Bummer. This would require modification of send as well as serve-static.

I see that send is using only stat and createReadStream. memory-fs implements these methods.

Supporting this feature would require send to introduce a factory abstraction.

This is too low of a priority for me to champion such change. I will rather simply write to the disk and continue using serve-static.

Lets leave this open and see if more people require this feature. I am sensing it might be an edge use case.

@acupofspirt
Copy link

I have the same issue. Is there any way to provide fs module?

@hinell
Copy link

hinell commented Feb 12, 2019

Highly related #pillarjs/send/issues/160

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants