So i wanna send some string value to my node server and find that value in MySQL table.
I have a component which is getting data from service
ngOnInit() {
this.instructionsService.getAllInstructions().subscribe(instructions => {
this.instructions = instructions;
});
}
Then i have a service which is fetching data from node server
getAllInstructions() {
return this.http.get('/api/profile/')
.map(res => res.json());
}
And finally i have node api
app.get('/profile',getAllInstructions);
function getAllInstructions(req,res){
connection.query("select * from users where id='somekindofid'",function(err, rows, fields) {
res.json(rows);
}
}
`
And i wanna replace that 'somekindofid' by the value ill be sending from my component
How can i do that?