diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/web/src/lib/hubFactory.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/web/src/lib/hubFactory.js b/src/web/src/lib/hubFactory.js new file mode 100644 index 00000000..f03d89a0 --- /dev/null +++ b/src/web/src/lib/hubFactory.js @@ -0,0 +1,18 @@ +import { + JsonHubProtocol, + HubConnectionBuilder, + LogLevel +} from '@microsoft/signalr' + +import { rootUrl } from '../config'; +import * as session from '../lib/session'; + +export const createApplicationHubConnection = () => + new HubConnectionBuilder() + .withUrl(`${rootUrl}/hub/application`, { + accessTokenFactory: session.getToken + }) + .withAutomaticReconnect() + .withHubProtocol(new JsonHubProtocol()) + .configureLogging(LogLevel.Information) + .build();
\ No newline at end of file |
