rexuws
Version:
An express-like framework built on top of uWebsocket.js aims at simple codebase and high performance
27 lines (26 loc) • 812 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = __importDefault(require("../../core"));
/**
* @abstract
* An abstract class which extends from `AbstractRoutingParser` and implements `IGetRouteHandlers` to
* allow accessing routeHandlers from outside
*/
class BaseRouter extends core_1.default {
add(method, args) {
const [path, middlewares] = this.transform(args);
this.routeHandlers.set(method + path, {
method,
middlewares,
path,
});
return this;
}
getRouteHandlers() {
return this.routeHandlers;
}
}
exports.default = BaseRouter;