summer-glove
Version:
[](https://www.npmjs.com/package/summer-glove) ## Fit like a glove 🧤 Summer-glove is a route manager, providing a quick and easy way to configure an express application. Summer-glo
14 lines (13 loc) • 1.01 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const ExpressInformationCore_1 = __importDefault(require("../core/ExpressInformationCore"));
function configureExpressService(className, method, endpoint, functionValue, context, ...middleware) {
ExpressInformationCore_1.default.getInstance().getObjectConfig().mappedApi[className][`${method} ` + endpoint] = {};
ExpressInformationCore_1.default.getInstance().getObjectConfig().mappedApi[className][`${method} ` + endpoint]["function"] = functionValue;
ExpressInformationCore_1.default.getInstance().getObjectConfig().mappedApi[className][`${method} ` + endpoint]["middleware"] = middleware;
ExpressInformationCore_1.default.getInstance().getObjectConfig().mappedApi[className][`${method} ` + endpoint]["context"] = context;
}
exports.default = configureExpressService;