-
-
Notifications
You must be signed in to change notification settings - Fork 109
Closed
Description
The npm start for one of my web apps runs a fastify server which uses fastify-static twice:
fastify
.register(fastifyStatic, {
prefix: '/dev/',
root: path.resolve('src')
})
.register(fastifyStatic, {
prefix: '/app/',
root: path.resolve('dist')
})The src directory always exists, this is the unmodified source. dist may or may not exist, it is the product of gulp build. Right now I use fs.mkdirSync(path.resolve('dist'), {recursive: true}) before initializing the fastifyStatic plugin to suppress the "root" path "${rootPath}" must exist error. It would be nice if I did not have to force creation of the empty folder for this to work, just let normal 404 logic deal with ENOENT at request time.
Are you open to this?
Metadata
Metadata
Assignees
Labels
No labels