Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

std/http/mod.ts>serveFile

The Deno Standard Library
Go to Latest
function serveFile
import { serveFile } from "https://deno.land/std@0.222.1/http/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]