Skip to main content
Module

x/drash/tests/deps.ts>Drash.Response#file

A microframework for Deno's HTTP server with zero third-party dependencies
Go to Latest
method Drash.Response.prototype.file
import { Drash } from "https://deno.land/x/drash@v2.7.0/tests/deps.ts";
const { Response } = Drash;

Set the body of this response as the contents of the given filepath. The Content-Type header will be set automatically based on the extension of the filepath.

Parameters

filepath: string
  • The filepath of the file to download, relative to the CWD that executed the entrypoint script.
optional
status: number
  • The status to respond with. Default on the response is 200.
optional
headers: Record<string, string> = [UNSUPPORTED]
  • Any extra headers you wish to specify apart of the content-type header