@loopeco/socketio
Version:
A enhanced LoopBack's WebSocket server based on socket.io
24 lines • 1.14 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SocketIoApplication = exports.ERR_NO_MULTI_SERVER = void 0;
const core_1 = require("@loopback/core");
const util_1 = require("util");
const mixins_1 = require("./mixins");
exports.ERR_NO_MULTI_SERVER = util_1.format('SocketApplication does not support multiple servers!', 'To create your own server bindings, please extend the Application class.');
class SocketIoApplication extends mixins_1.SocketIoMixin(core_1.Application) {
constructor(configOrParent, parent) {
super(configOrParent, parent);
}
// Unfortunately, TypeScript does not allow overriding methods inherited
// from mapped types. https://github.com/microsoft/TypeScript/issues/38496
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
server(server, name) {
if (this.findByTag('server').length > 0) {
throw new Error(exports.ERR_NO_MULTI_SERVER);
}
return super.server(server, name);
}
}
exports.SocketIoApplication = SocketIoApplication;
//# sourceMappingURL=socketio.application.js.map