I am trying to delete an entry from json data.
This is what I do to view the data:
app.route('/data/:id')
.get((req:Request, res: Response) => {
let id = req.params.id;
res.status(200).send(projects[id]);
});
And that will show the data with that id in the json data.
This is what I've got to delete:
app.route('/data/delete/:id')
.delete((req:Request, res: Response) => {
let id = req.params.id;
res.status(200).send(projects[id]);
});
What I'm I doing wrong, missing from the delete code above?