Skip to content

Commit

Permalink
try removing the regex while modifying the globPattern
Browse files Browse the repository at this point in the history
  • Loading branch information
gurgunday committed Sep 5, 2023
1 parent 75f12db commit baf24ce
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,14 +336,12 @@ async function fastifyStatic (fastify, opts) {
})
}
} else {
const globPattern = '**/**'
const globPattern = '**'
const indexDirs = new Map()
const routes = new Set()

const winSeparatorRegex = new RegExp(`\\${path.win32.sep}`, 'g')

for (const rootPath of Array.isArray(sendOptions.root) ? sendOptions.root : [sendOptions.root]) {
const files = await glob(path.join(rootPath, globPattern).replace(winSeparatorRegex, path.posix.sep), { follow: true, nodir: true, dot: opts.serveDotFiles })
const files = await glob(path.join(rootPath, globPattern), { follow: true, nodir: true, dot: opts.serveDotFiles })
const indexes = typeof opts.index === 'undefined' ? ['index.html'] : [].concat(opts.index)

for (let file of files) {
Expand Down

0 comments on commit baf24ce

Please sign in to comment.