From 8d98e3d3ef3bd2cc70bd479b8d186b3eea2eca8b Mon Sep 17 00:00:00 2001 From: Eyuep Sueyruege Date: Tue, 14 Nov 2023 16:17:17 +0100 Subject: [PATCH] Update src/server/server.js --- src/server/server.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/server/server.js b/src/server/server.js index 16b7681..d6652f9 100644 --- a/src/server/server.js +++ b/src/server/server.js @@ -20,7 +20,7 @@ app.use(express.static('public')); // Setting of Port of Arduino const arduinoPort = new SerialPort({ - path: 'COM3', + path: 'COM6', baudRate: 9600 }); @@ -38,15 +38,13 @@ function waitForData() { } // fetching data from Serialport: Getting Hand Information of the Player -function waitForData(playerid) { - return "coming soon!" -} + // Get Request for Playerhand app.get('/cardinmyhand/:playerid', async (req, res) => { try { const playerid = req.params.playerid; - const data = await waitForData(playerid); // Warte auf Daten von der seriellen Schnittstelle + const data = await waitForData(); // Warte auf Daten von der seriellen Schnittstelle res.send(data); // Sende die Daten an den Client } catch (error) { res.status(500).send('Fehler beim Lesen der Daten');