Module
A microframework for Deno's HTTP server with zero third-party dependencies
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556import { Request, Resource, Response } from "../mod.ts";
/** * The allowed types for an HTTP method on a resource. */export type HttpMethodName = | "CONNECT" | "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT" | "TRACE";
export type BodyFile = { content: Uint8Array; size: number; type: string; filename: string;};
export type HttpHeadersKeyValuePairs = Record<string, string>;
export type ResourcesAndPatternsMap = Map<number, { resource: Resource; patterns: URLPattern[];}>;
export type ResourceHttpMethodHandler = ( request: Request, response: Response,) => Promise<void> | void;
/** * Request options to use when creating the `Drash.Server` object. * * @example * * ```typescript * const server = new Drash.Server({ * ... * ... * ... * request: { * read_body: false, * } * }); * ``` */export type RequestOptions = Partial<{ /** Should incoming requests have their bodies read? */ read_body: boolean;}>;