UNPKG

exstack

Version:

A utility library designed to simplify and enhance Express.js applications.

36 lines (34 loc) 717 B
//#region src/types.ts /** * Constant representing a wildcard or catch-all HTTP method. * * Used for handlers that apply to all methods. * * @example * ```ts * router.add(METHOD_NAME_ALL, '*', globalMiddleware); * ``` */ const METHOD_NAME_ALL = "ALL"; /** Lowercase equivalent of {@link METHOD_NAME_ALL}. */ const METHOD_NAME_ALL_LOWERCASE = "all"; /** * Supported HTTP methods (lowercase). * * @example * ```ts * METHODS.forEach(method => router.add(method, '/ping', pingHandler)); * ``` */ const METHODS = [ "get", "post", "put", "delete", "options", "patch" ]; //#endregion exports.METHODS = METHODS; exports.METHOD_NAME_ALL = METHOD_NAME_ALL; exports.METHOD_NAME_ALL_LOWERCASE = METHOD_NAME_ALL_LOWERCASE;