-
-
Notifications
You must be signed in to change notification settings - Fork 111
Open
Labels
good first issueGood for newcomersGood for newcomerssemver-minorIssue or PR that should land as semver minorIssue or PR that should land as semver minor
Description
🚀 Feature Proposal
With an optional render function for dirlist we could change the results for the json output by either removing files we don't want to show (filter all non-images) or send more data (adding more stats, mimetype or other data)
Motivation
I'd like to have a image server running that connects to a directory and only sends out images, the client should not see other data
Example
fastify.register(fastifyStatic, {
root: path.resolve(options.imagePath),
prefix: options.path,
dotfiles: 'ignore',
list: {
format: 'json',
names: ['index', 'index.json', '/', ''],
render: (files, dirs) => {
return {
files: files.filter(file => !isImage(file)).map(file => generateImageInfo(file)),
dirs,
}
}
},
})Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomerssemver-minorIssue or PR that should land as semver minorIssue or PR that should land as semver minor