Static file server class.

Hierarchy

  • Static

Constructors

Properties

_assets: undefined | AssetIndex
assetDir: string = 'assets'

Subdirectory used for all static assets.

prefix: string = '/static'

Prefix to use for all static files.

publicPaths: string[] = ...

Directories to serve static files from, first one has the highest precedence.

Methods

  • Parameters

    Returns Promise<void>

  • Get static asset path.

    Parameters

    • path: string

    Returns string

  • Serve static files.

    Parameters

    Returns Promise<boolean>

  • Get static file path with prefix.

    Parameters

    • path: string

    Returns string

  • Check freshness of request by comparing the If-None-Match and If-Modified-Since request headers to the ETag and Last-Modified response headers.

    Parameters

    • ctx: MojoContext
    • options: {
          etag?: string;
          lastModified?: Date;
      } = {}
      • Optional etag?: string
      • Optional lastModified?: Date

    Returns boolean

  • Serve a specific file.

    Parameters

    Returns Promise<void>

  • Prepare static assets.

    Returns Promise<void>

Generated using TypeDoc