@mojojs/core
    Preparing search index...

    Class Static

    Static file server class.

    Index
    _assets: AssetIndex | undefined
    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.

    • 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 } = {}

      Returns boolean

    • Serve a specific file.

      Parameters

      Returns Promise<void>

    • Prepare static assets.

      Returns Promise<void>