app.delete()

PHOTO EMBED

Sun Apr 03 2022 23:50:32 GMT+0000 (UTC)

Saved by @wulfsounds #express

app.delete('/expressions/:id',(req,res,next)=>{
      const eleIndex = getIndexById(req.params.id,expressions);
    if(eleIndex!==-1){
        expressions.splice(eleIndex,1);
        res.status(204).send(expressions[eleIndex]);
    }
    else{
        res.status(404).send();
    }
});
content_copyCOPY

https://www.thiscodeworks.com/app-delete-how-to-use-delete-in-express-and-set-up-route-node/612ddb940032010015329851