ufiber
Version:
Next-gen webserver for node-js developer
41 lines (39 loc) • 1.14 kB
JavaScript
const require_tools = require('./utils/tools.cjs');
//#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 = require_tools.parseBytes("512KB");
const kMatch = Symbol("kMatch");
const kCtxRes = Symbol("kCtxRes");
const kCtxReq = Symbol("kCtxReq");
//#endregion
exports.HIGH_WATER_MARK = HIGH_WATER_MARK;
exports.MESSAGE_MATCHER_IS_ALREADY_BUILT = MESSAGE_MATCHER_IS_ALREADY_BUILT;
exports.METHODS = METHODS;
exports.METHOD_NAME_ALL = METHOD_NAME_ALL;
exports.METHOD_NAME_ALL_LOWERCASE = METHOD_NAME_ALL_LOWERCASE;
exports.kCtxReq = kCtxReq;
exports.kCtxRes = kCtxRes;
exports.kMatch = kMatch;