From 381604514b275246c09e7f003c2392804894c215 Mon Sep 17 00:00:00 2001
From: Omar Elkadi <omar.elkadi@stud.th-deg.de>
Date: Wed, 23 Jun 2021 02:47:21 +0200
Subject: [PATCH] add HTTP data reciver  on /pdata route

---
 server/src/routes/dataRoutes.ts | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/server/src/routes/dataRoutes.ts b/server/src/routes/dataRoutes.ts
index 4102668..ae85a87 100644
--- a/server/src/routes/dataRoutes.ts
+++ b/server/src/routes/dataRoutes.ts
@@ -15,6 +15,7 @@ export class dataRoutes {
     routes() {
         console.log("Data routes");
         this.router.get("/data", this.get); // get data
+        this.router.post('/pdata', this.post)
     }
 
     get(req: Request, res: Response) {
@@ -36,4 +37,10 @@ export class dataRoutes {
                 res.status(200).send(td); // respond with data in array
             });
     }
+
+    post(req: Request, res: Response) {
+        let body = req.body;
+        console.log(body);
+        res.status(200).send(body)
+    }
 }
-- 
GitLab