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

x/ghst/res.ts>HTTPResponse#setStatus

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

Sets the status code of the response.

Examples

const ghst = new GhstApplication({ on404: (req,res) => { res.setStatus(404).send("404"); } });

Parameters

code: number

Status code.