It happens that I have this code, where I try to pass by the user parameter and password using as a postman tool, I'm honestly new to this so I do not know if I'm doing well or the code is wrong since I get this error in postman
app.post('api/v1/Login/:user/:pass',function(request, res){
var usuario = request.params.user;
var contraseña = request.params.pass;
var request = new sql.Request();
try{
request.query("SELECT * FROM dbo.[Client] WHERE username = '"+UsuarioReg+"'AND pass = '"+ContraReg+"'", function (err, recordset) {
if(err){
console.log(err);
}else{
if(recordset.rowsAffected > 0){
res.send(JSON.stringify("Usuario identificado correctamente"))
res.send(JSON.stringify(recordset))
console.log("Usuario identificado correctamente")
}else{
console.log("Usuario ["+UsuarioReg+"] no existe")
}
}
})
}catch(err){
res.send(JSON.stringify("Error while querying database :- "+err))
console.log("Error while querying database :- "+err)
}
});
I would like to know what happens and how to solve it! Sorry if the question is not clear.