std/http/file_server.ts

Deno standard library
Go to Latest
function serveFile
import { serveFile } from "https://deno.land/std@0.147.0/http/file_server.ts?s=serveFile";

Returns an HTTP Response with the requested file as the body.

Parameters

req: Request[src]

The server request context used to cleanup the file handle.

filePath: string[src]

Path of the file to serve.

optional
unnamed 2: ServeFileOptions
[src]

Returns

Promise<Response>[src]