From 19e837cd2c88f66f75e0a1de406a47c0fab32106 Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Tue, 7 Apr 2020 10:57:43 +0000 Subject: [PATCH] Add missing dependancy, fix some bugs --- api/casparcg/client.mjs | 2 +- api/routerio.mjs | 4 ++-- api/server.mjs | 2 +- package.json | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api/casparcg/client.mjs b/api/casparcg/client.mjs index 0620be6..01e0494 100644 --- a/api/casparcg/client.mjs +++ b/api/casparcg/client.mjs @@ -14,7 +14,7 @@ let casparIsConnected let currentHost export function initialise(log, db, socket) { - io = socket.socket + io = socket logger = log db = db diff --git a/api/routerio.mjs b/api/routerio.mjs index dbda909..e30dc71 100644 --- a/api/routerio.mjs +++ b/api/routerio.mjs @@ -11,8 +11,8 @@ import * as settings from './settings/routes.mjs' import * as schedule from './schedule/routes.mjs' function onConnection(server, db, data) { - const io = server.socket - const socket = data.socket + const io = server + const socket = data const log = logger.child({ id: socket.id, }) diff --git a/api/server.mjs b/api/server.mjs index 25bbdd7..8b06a8b 100644 --- a/api/server.mjs +++ b/api/server.mjs @@ -33,7 +33,7 @@ lowdb().then(function(db) { } child[level]({ - duration: (d2 - d1), + duration: requestTime, status: res.statusCode, }, `<-- ${req.method} ${req.url}`) } diff --git a/package.json b/package.json index 01d7a86..041a197 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "lodash.template": "^4.5.0", "lowdb": "^1.0.0", "nconf": "^0.9.1", + "node-static": "^0.7.11", "socket.io-serveronly": "^2.3.0", "tslib": "^1.11.1" },