UNPKG

@sigiljs/sigil

Version:

TypeScript-first Node.js HTTP framework offering schema-driven routing, modifier-based middleware, plugin extensibility, and flexible response templating

23 lines (22 loc) 642 B
import n from "../requests/containers/incoming-headers.mjs"; import r from "./sigil-response.mjs"; class p extends r { /** * HTTP status code for file responses (defaults to 200). */ code = 200; /** * Constructs a new FileResponse. * * @param path - Filesystem path to the file to serve. * @param contentType - Optional MIME type of the file (e.g., "image/png"). * @param encoding - Text encoding for file content (defaults to "utf8"). */ constructor(o, s, t = "utf8") { const e = new n(); e.set("content-encoding", t), s && e.set("content-type", s), super(o, 200, e); } } export { p as default };