From 2e4a56daa3a54b2e468146647231cdff1957f8b6 Mon Sep 17 00:00:00 2001 From: Saba Date: Sat, 27 Nov 2021 10:50:05 -0500 Subject: [PATCH] Add script for reading config --- views/scripts/readWriteConfig.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 views/scripts/readWriteConfig.js diff --git a/views/scripts/readWriteConfig.js b/views/scripts/readWriteConfig.js new file mode 100644 index 00000000..36b3fbc8 --- /dev/null +++ b/views/scripts/readWriteConfig.js @@ -0,0 +1,11 @@ +var showConfig = document.getElementById("show-config"); +showConfig.addEventListener("click", () => { + fetch("/config") + .then(response => response.json()) + .then(data => { + for (let key in data) { + console.log('key: ', key); + console.log(data[key]); + } + }); +}); \ No newline at end of file