Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Omar Elkadi
PStA WP2 OmarElkadi1
Commits
38160451
Commit
38160451
authored
Jun 23, 2021
by
Omar Elkadi
Browse files
add HTTP data reciver on /pdata route
parent
c91a4f65
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/src/routes/dataRoutes.ts
View file @
38160451
...
...
@@ -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
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment