function serveFile
serveFile(
ctx: Context,
path: string,
unnamed 2: ServeFileOptions
): Promise<boolean>

Sends a file from disk with an ETag, answering 304 when the client already has it, and single byte ranges when ranges is set. It returns false, having sent nothing, when the file doesn't exist, and leaves the 404 to the caller.

Parameters

ctx: Context
path: string

Return Type

Promise<boolean>

Usage

import { serveFile } from "api/lib/serve-file.ts";