From 4dc4c85fb9b42e3e404d7d884b90f2977fdd72ad Mon Sep 17 00:00:00 2001 From: "Ruben Hartenstein (PEA4-Fe)" Date: Tue, 9 Mar 2021 17:01:24 +0100 Subject: [PATCH] Extract data from request --- src/routes/measurement.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/routes/measurement.ts b/src/routes/measurement.ts index 458c95f..2b6ce6f 100644 --- a/src/routes/measurement.ts +++ b/src/routes/measurement.ts @@ -126,6 +126,11 @@ router.post('/measurement/new', async (req, res, next) => { }); }); +router.post('/measurement/new/raspi', (req, res) => { + if (!req.auth(res, Object.values(globals.levels))) return; + // Needed data to rebuild measurement structure + JSON.parse(String.fromCodePoint(...req._readableState.buffer.head.data)).value; +}); module.exports = router;