I am working on a simple API for searching using NodeJs and express, I coded in my server.js like this
app.get('/enduser/search/:keyword', function (req, res) {
let keyword = req.body.keyword;
if (!keyword) {
return res.status(400).send({ error: true, message: 'Please provide a keyword' });
}
dbConn.query("SELECT * FROM user_tbl WHERE cp_1 LIKE =? ", ['%' + keyword + '%'], (err, results) => {
if (err) throw err;
//return res.send({ err: false, data: results, message: 'Enduser search list.' });
return res.status(200).json({"status": 200, "err" : null, "data": results});
});
});
I got no errors when running on terminal, but i cannot get response when testing the API using postman. When I try to test using postman ... i got the error like this:

I tried some methods but still cannot figure out whats wrong.
cp_1also please use try-catch to avoid the unexpected crashing expressjs.com/en/guide/error-handling.html