UNPKG

@glandjs/http

Version:

A protocol adapter for HTTP built on top of the Gland architecture solution.

19 lines (18 loc) 594 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HttpBroker = void 0; const core_1 = require("@glandjs/core"); class HttpBroker extends core_1.BrokerAdapter { constructor(instance, options) { super(options); this.instance = instance; this.broker = this.instance.broker; } initialize() { this.broker.on('gland:define:route', (payload) => { this.instance[payload.method.toLowerCase()](payload.meta.path, payload.action); }); return this.instance; } } exports.HttpBroker = HttpBroker;