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

x/ghst/res.ts>HTTPResponse#render

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

Reads a file and replaces text with specified values.

Examples

const ghst = new GhstApplication();

ghst.onRequest("/","GET",(req,res) => { res.render("./public/index.html",{ foo: "bar" }); });

Example 2

<body>
	<h1>{{ FOO }}</h1>
</body>

Parameters

path: string

The path of the file.

values: Record<string, string>

The values to replace text with.