You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues to ensure the feature has not already been requested
🚀 Feature Proposal
I believe it is a good idea to provide an interface for file serving through different storage engine.
For example,
File System (which is currently)
MongoDB GridFS
S3 compatible interface
Motivation
Manage of Range header is hard and maybe problematic.
Instead, we can provide a generic interface for the user to choose storage engine.
Then, we provide all the others function.
It enables the user to highly customize how to serve file based on their application logic and provide a proper storage engine.
Even file system serving can be customize in this case.
Example
importFastifyfrom'fastify'importFastifyStaticfrom'@fastify/static'importFastifyMongoDBfrom'@fastify/mongodb'import{MongoDBGridFS}from'@fastify/static/engine'constfastify=Fastify()fastify.register(FastifyMongoDB,{// proper configuration here// not to demo how to use mongodb})fastify.register(FastifyStatic,{engine: MongoDBGridFS,db: fastify.mongo.db,bucketName: 'vfs'})// you can serve the file like currently// but it is backed by other engine
The text was updated successfully, but these errors were encountered:
Prerequisites
🚀 Feature Proposal
I believe it is a good idea to provide an interface for file serving through different storage engine.
For example,
Motivation
Manage of
Range
header is hard and maybe problematic.Instead, we can provide a generic interface for the user to choose storage engine.
Then, we provide all the others function.
It enables the user to highly customize how to serve file based on their application logic and provide a proper storage engine.
Even file system serving can be customize in this case.
Example
The text was updated successfully, but these errors were encountered: