I have been told issuing a redirect('/')
for API requests is not RESTful. I have been doing it like so:
app.delete('/items/:id', urlencodedParser, (req, res) => {
let index = parseInt(req.params.id);
items.splice(index, 1);
res.redirect('/');
});
I now know this is wrong. But then what do I need to do to update the content on the HTML web page without refreshing the page manually?
Read more here: https://stackoverflow.com/questions/65835547/how-to-update-html-content-without-using-redirect-after-a-rest-request
Content Attribution
This content was originally published by SpiderWebbs at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.