Skip to content
Snippets Groups Projects
Commit 38160451 authored by Omar Elkadi's avatar Omar Elkadi
Browse files

add HTTP data reciver on /pdata route

parent c91a4f65
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,7 @@ export class dataRoutes { ...@@ -15,6 +15,7 @@ export class dataRoutes {
routes() { routes() {
console.log("Data routes"); console.log("Data routes");
this.router.get("/data", this.get); // get data this.router.get("/data", this.get); // get data
this.router.post('/pdata', this.post)
} }
get(req: Request, res: Response) { get(req: Request, res: Response) {
...@@ -36,4 +37,10 @@ export class dataRoutes { ...@@ -36,4 +37,10 @@ export class dataRoutes {
res.status(200).send(td); // respond with data in array 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)
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment