ServeStaticModuleOptions


interface ServeStaticModuleOptions {
  rootPath?: string
  renderPath?: string | RegExp
  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: * (wildcard - all paths). Note: RegExp is not supported by the @nestjs/platform-fastify.

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; }

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