Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/ghst/res.ts>HTTPResponse#sendFile

A light-weight http framework built for Deno.
Latest
method HTTPResponse.prototype.sendFile
import { HTTPResponse } from "https://deno.land/x/ghst@v1.1.4/res.ts";

Sets the body of the response to be the contents of a file.

Examples

const ghst = new GhstApplication();

ghst.onRequest("/","GET",(req,res) => { res.sendFile("./public/index.html"); });

Parameters

path: string

The file you want to show in the body of the response.