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

Added parameters for custom glob patterns and glob options... #375

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
simpler solution
  • Loading branch information
Uzlopak authored May 14, 2023
commit b58d7923f58361da75930f3a1c288347cabed4ab
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ async function fastifyStatic (fastify, opts) {
})
}
} else {
const globPattern = opts.globPattern !== undefined ? opts.globPattern : '**/**'
const globOptions = typeof opts.globOptions === 'object' ? { ...{ nodir: true, dot: opts.serveDotFiles }, ...opts.globOptions } : { nodir: true, dot: opts.serveDotFiles }
const globPattern = opts.globPattern || '**/**'
const globOptions = opts.globOptions || { nodir: true, dot: opts.serveDotFiles }
const indexDirs = new Map()
const routes = new Set()

Expand Down