// www/js/todolist.js $scope.encerrartarefa=function(tarefa){ $http({ method : "POST", url : "encerrartarefa?idtarefa="+tarefa.idtarefa, }).then(function(res){ alert(res.data); $scope.inittodolist(); }); }; // index.js app.post("/encerrartarefa",function(req,res){ // var deletartarefa = req.body; knex("tarefas").where({ idtarefa:req.query.idtarefa }).del().then(function(retid){ res.send("Tarefa: "+req.query.idtarefa+" removida"); }).catch(function(err){ console.log(err); res.status(500).send("Erro ao remover tarefa"); }); console.log("testestesfadsad"); });