Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

abstract the plugin to provide support of virtual file system

Open
#432 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, mongodb
Domain
backend, databases

Research direction

No files or tests are named. Start by reading the plugin's current file-serving and Range-header handling, then examine how a generic storage-engine boundary could support the existing filesystem path and the proposed MongoDB GridFS example. Done would require an agreed design that preserves current serving behavior while enabling alternate storage engines.

Written by the indexing model from the issue text.

Description

feature request
Prerequisites
  • I have written a descriptive issue title
  • 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,

  1. File System (which is currently)
  2. MongoDB GridFS
  3. 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
import Fastify from 'fastify'
import FastifyStatic from '@fastify/static'
import FastifyMongoDB from '@fastify/mongodb'
import { MongoDBGridFS } from '@fastify/static/engine'

const fastify = 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
Dominant language
JavaScript
Stars
499
Forks
131
Avg merge
1d 18h
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fastify/fastify-static

All issues in fastify/fastify-static

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.