ufiber
Version:
Next-gen webserver for node-js developer
34 lines (32 loc) • 925 B
JavaScript
import { parseBytes } from "./utils/tools.js";
//#region src/consts.ts
/**
* Constant representing all HTTP methods in uppercase.
*/
const METHOD_NAME_ALL = "ALL";
/**
* Constant representing all HTTP methods in lowercase.
*/
const METHOD_NAME_ALL_LOWERCASE = "all";
/**
* Array of supported HTTP methods.
*/
const METHODS = [
"get",
"post",
"put",
"delete",
"options",
"patch"
];
/**
* Error message indicating that a route cannot be added because the matcher is already built.
*/
const MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built.";
/** Default chunk size (512KB) */
const HIGH_WATER_MARK = parseBytes("512KB");
const kMatch = Symbol("kMatch");
const kCtxRes = Symbol("kCtxRes");
const kCtxReq = Symbol("kCtxReq");
//#endregion
export { HIGH_WATER_MARK, MESSAGE_MATCHER_IS_ALREADY_BUILT, METHODS, METHOD_NAME_ALL, METHOD_NAME_ALL_LOWERCASE, kCtxReq, kCtxRes, kMatch };