UNPKG

zents

Version:

ZenTS is a Node.js & TypeScript MVC-Framework for building rich web applications, released as free and open-source software under the MIT License. It is designed for building web applications with modern tools and design patterns.

25 lines 1.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RequestFactory = void 0; const ControllerRequestHandler_1 = require("./requesthandlers/ControllerRequestHandler"); const enums_1 = require("../types/enums"); const SecurityRequestHandler_1 = require("./requesthandlers/SecurityRequestHandler"); class RequestFactory { constructor(registry) { this.registry = registry; } build(context, config, route) { let handler; switch (config.type) { case enums_1.REQUEST_TYPE.CONTROLLER: handler = new ControllerRequestHandler_1.ControllerRequestHandler(context, this.registry.factories.controller, config.controllerKey, config.loadedUser, route); break; case enums_1.REQUEST_TYPE.SECURITY: handler = new SecurityRequestHandler_1.SecurityRequestHandler(context, this.registry.getConnection(), config); break; } return handler; } } exports.RequestFactory = RequestFactory; //# sourceMappingURL=RequestFactory.js.map