From 9c997997b9895754bf2c5c493b9be8e34858ed92 Mon Sep 17 00:00:00 2001 From: Daniel Kim Date: Thu, 13 Dec 2018 00:10:33 +0000 Subject: [PATCH] Finalize server build --- index.js | 9 ++++++++- text.json | 17 ++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 5d9a2ce..777ba48 100644 --- a/index.js +++ b/index.js @@ -316,7 +316,14 @@ function reduceFinished(call, callback) { for(let i = 0; i < aliveNodePorts.length; i++) { if (sortedStringList[i]) { - printString += sortedStringList[i]; + // ------------- If anything broke delete code between lines ----------- + console.log(JSON.parse(sortedStringList[i])); + let sortedJSONList = JSON.parse(sortedStringList[i]); + Object.entries(sortedJSONList).forEach(element =>{ + printString += element[0] +"\n" + element[1] +"\n"; + }); + // --------------------------------------------------------------------- + //printString += sortedStringList[i] + "\n"; } } diff --git a/text.json b/text.json index e854167..2bd74e4 100644 --- a/text.json +++ b/text.json @@ -1,3 +1,14 @@ -{"Come Together":"{\"album\":\"Abbey Road\",\"artist\":\"The Beatles\",\"clicks\":0,\"guid\":\"e18f7c6f7e34c42b05cf486a08e6b782d9abb226\"}","Feel Good Inc.":"{\"album\":\"Demon Days\",\"artist\":\"Gorillaz\",\"clicks\":0,\"guid\":\"e7cf9b81e8e9549eb696006ac984cba13617c6fa\"}","Help!":"{\"album\":\"Help!\",\"artist\":\"The Beatles\",\"clicks\":0,\"guid\":\"010ec1bd60f593c48c1264ba628cc37eb57a7e8e\"}","Hooked on a Feeling":"{\"album\":\"Hooked on a Feeling\",\"artist\":\"Blue Swede\",\"clicks\":0,\"guid\":\"43c6fc3191430c09fcf00f205454a7b488dcf0f9\"}"} -{"Help!":"{\"album\":\"Help!\",\"artist\":\"The Beatles\",\"clicks\":0,\"guid\":\"010ec1bd60f593c48c1264ba628cc37eb57a7e8e\"}","Hooked on a Feeling":"{\"album\":\"Hooked on a Feeling\",\"artist\":\"Blue Swede\",\"clicks\":0,\"guid\":\"43c6fc3191430c09fcf00f205454a7b488dcf0f9\"}","Lucky You":"{\"album\":\"Kamikaze\",\"artist\":\"Eminem\",\"clicks\":0,\"guid\":\"94cb2803a7a40db8da4872a3dcd762f013b0f786\"}","Pumped Up Kicks":"{\"album\":\"Pumped Up Kicks\",\"artist\":\"Foster the People\",\"clicks\":0,\"guid\":\"4a41bdb092d604d05c679b9a0d68a86541880685\"}"} -{"Pumped Up Kicks":"{\"album\":\"Pumped Up Kicks\",\"artist\":\"Foster the People\",\"clicks\":0,\"guid\":\"4a41bdb092d604d05c679b9a0d68a86541880685\"}","September":"{\"album\":\"September\",\"artist\":\"Earth, Wind & Fire\",\"clicks\":0,\"guid\":\"d85c96151e7677574203a7e2c70950392a299000\"}"} +Come Together +{"album":"Abbey Road","artist":"The Beatles","clicks":0,"guid":"e18f7c6f7e34c42b05cf486a08e6b782d9abb226"} +Feel Good Inc. +{"album":"Demon Days","artist":"Gorillaz","clicks":0,"guid":"e7cf9b81e8e9549eb696006ac984cba13617c6fa"} +Help! +{"album":"Help!","artist":"The Beatles","clicks":0,"guid":"010ec1bd60f593c48c1264ba628cc37eb57a7e8e"} +Hooked on a Feeling +{"album":"Hooked on a Feeling","artist":"Blue Swede","clicks":0,"guid":"43c6fc3191430c09fcf00f205454a7b488dcf0f9"} +Lucky You +{"album":"Kamikaze","artist":"Eminem","clicks":0,"guid":"94cb2803a7a40db8da4872a3dcd762f013b0f786"} +Pumped Up Kicks +{"album":"Pumped Up Kicks","artist":"Foster the People","clicks":0,"guid":"4a41bdb092d604d05c679b9a0d68a86541880685"} +September +{"album":"September","artist":"Earth, Wind & Fire","clicks":0,"guid":"d85c96151e7677574203a7e2c70950392a299000"}