Skip to main content
Module

x/file_server_plus/mod.ts>serveFile

`deno` static file webserver clone of `file_server.ts`, PLUS optional command line arg: `--handler FILE.ts` for "404 handler" ability to run arbitrary JS/TS
Go to Latest
function serveFile
import { serveFile } from "https://deno.land/x/file_server_plus@0.2.1/mod.ts";

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

Parameters

req: Request

The server request context used to cleanup the file handle.

filePath: string

Path of the file to serve.

optional
unnamed 2: ServeFileOptions = [UNSUPPORTED]