From 5a876b1212219e42f4afb42bb8886e2ae6b16ec1 Mon Sep 17 00:00:00 2001 From: softsimon Date: Tue, 26 May 2020 16:34:55 +0700 Subject: [PATCH] Add hostname to initial websocket data. --- backend/src/api/websocket-handler.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/api/websocket-handler.ts b/backend/src/api/websocket-handler.ts index ecbc7f6d8..a80768957 100644 --- a/backend/src/api/websocket-handler.ts +++ b/backend/src/api/websocket-handler.ts @@ -7,6 +7,7 @@ import blocks from './blocks'; import memPool from './mempool'; import mempoolBlocks from './mempool-blocks'; import fiatConversion from './fiat-conversion'; +import * as os from 'os'; class WebsocketHandler { private wss: WebSocket.Server | undefined; @@ -92,7 +93,8 @@ class WebsocketHandler { 'blocks': _blocks.slice(Math.max(_blocks.length - config.INITIAL_BLOCK_AMOUNT, 0)), 'conversions': fiatConversion.getTickers()['BTCUSD'], 'mempool-blocks': mempoolBlocks.getMempoolBlocks(), - 'git-commit': this.latestGitCommitHash + 'git-commit': this.latestGitCommitHash, + 'hostname': os.hostname(), })); }