Skip to content

Feature Request: Option to ignore ENOENT in checkRootPathForErrors #101

@coreyfarrell

Description

@coreyfarrell

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions