UNPKG

457 BJavaScriptView Raw
1"use strict";
2
3var router = require("./router.js");
4
5exports.adapters = {
6 http: require("./transport/http/httpAdapter.js"),
7 ws: require("./transport/ws/wsAdapter.js")
8};
9
10exports.router = function() {
11 return router;
12};
13
14exports.use = function (plugin, config) {
15 this._plugins = this._plugins || [];
16
17 if (this._plugins.indexOf(plugin) === -1) {
18 plugin(this, config);
19 this._plugins.push(plugin);
20 }
21
22 return this;
23};