UNPKG

@loopeco/socketio

Version:

A enhanced LoopBack's WebSocket server based on socket.io

35 lines 1.54 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SocketIoComponent = void 0; const tslib_1 = require("tslib"); const core_1 = require("@loopback/core"); const booters_1 = require("./booters"); const keys_1 = require("./keys"); const providers_1 = require("./providers"); const socketio_sequence_1 = require("./socketio.sequence"); const socketio_server_1 = require("./socketio.server"); let SocketIoComponent = class SocketIoComponent { constructor(app) { this.booters = [booters_1.SocketIoBooter]; this.providers = { [keys_1.SocketIoBindings.INVOKE_METHOD.key]: providers_1.SocketIoInvokeMethodProvider, [keys_1.SocketIoBindings.SEND_METHOD.key]: providers_1.SocketIoSendProvider, [keys_1.SocketIoBindings.REJECT_METHOD.key]: providers_1.SocketIoRejectProvider, }; /** * Add built-in body parsers */ this.bindings = []; this.servers = { SocketServer: socketio_server_1.SocketIoServer, }; app.bind(keys_1.SocketIoBindings.REQUEST_LISTENER).to(() => { }); app.bind(keys_1.SocketIoBindings.SEQUENCE).toClass(socketio_sequence_1.DefaultSocketIoSequence); } }; SocketIoComponent = tslib_1.__decorate([ tslib_1.__param(0, core_1.inject(core_1.CoreBindings.APPLICATION_INSTANCE)), tslib_1.__metadata("design:paramtypes", [core_1.Application]) ], SocketIoComponent); exports.SocketIoComponent = SocketIoComponent; //# sourceMappingURL=socketio.component.js.map