ServeStaticModuleOptions


interface ServeStaticModuleOptions {
  rootPath?: string
  renderPath?: string | RegExp
  useGlobalPrefix?: boolean
  serveRoot?: string
  exclude?: string[]
  serveStaticOptions?: {...}
}

Properties

Property Description
rootPath?: string

Static files root directory. Default: "client"

renderPath?: string | RegExp

Path to render static app (concatenated with the serveRoot value). Default (express): {*any} (wildcard - all paths). Default (fastify): * (wildcard - all paths).

useGlobalPrefix?: boolean

If true, static app will be prefixed by the global prefix set through setGlobalPrefix(). Default: false.

serveRoot?: string

Root path under which static app will be served. Default: ""

exclude?: string[]

Paths to exclude when serving the static app. WARNING! Not supported by fastify. If you use fastify, you can exclude routes using regexp (set the renderPath to a regular expression) instead.

serveStaticOptions?: { cacheControl?: boolean; dotfiles?: string; etag?: boolean; fallthrough?: boolean; extensions?: string[]; immutable?: boolean; index?: boolean | string | string[]; lastModified?: boolean; maxAge?: number | string; redirect?: boolean; setHeaders?: (res: any, path: string, stat: any) => any; preCompressed?: boolean; decorateReply?: boolean; }

Serve static options (static files) Passed down to the underlying either express.static or fastify-static.send