From f59ea3e3ed8bb97fe1ae347e1d7b2119aa4f4f2d Mon Sep 17 00:00:00 2001 From: krakenrf <> Date: Thu, 27 Oct 2022 11:28:39 +0100 Subject: add middleware folder --- middleware | 1 - middleware/simulation_pr.js | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) delete mode 160000 middleware create mode 100644 middleware/simulation_pr.js (limited to 'middleware/simulation_pr.js') diff --git a/middleware b/middleware deleted file mode 160000 index fd52f67..0000000 --- a/middleware +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fd52f677a62a9a0728b4ab87d687e709f3e681de diff --git a/middleware/simulation_pr.js b/middleware/simulation_pr.js new file mode 100644 index 0000000..2645fb8 --- /dev/null +++ b/middleware/simulation_pr.js @@ -0,0 +1,16 @@ +const axios = require('axios'); + +setInterval(() => { + + var rb = Math.floor(Math.random() * 49) + 1; + var prData = {"rb": rb}; + + console.log("Sending PR Data as kraken: "+prData.rb) + axios.post('http://localhost:8042/prpost', prData) + .then(function (response) { + //console.log(response); + }) + .catch(function (error) { + console.log(error); + }); +}, 5000); \ No newline at end of file -- cgit v1.2.3