Closed rosdec closed 1 year ago
It's the same as with express:
app.post('/api/validation', function(req, res) {
req.json().then(json => {
if (json.data?.length > 0) {
return res.json({result: true});
}
return res.json({result: false});
});
});
Hey! Thanks! This was really way easier than I thought.
Ciao,
I'm enjoying your little library but still cannot wrap my mind around an example of using a POST endpoint. You provided plenty of GET examples, and they helped, but POST and how to handle the body would really help.
I'm working on it, when (if) I'll succeed I'll provide a PR!
Best, rosdec