I did this get, with the intention of returning the amount of clients that the application needed, but insomnia only returns that it didn't find the route:
server.get('/consultclients?amount=1', (req,res) =>{
let amount = req.params.amount;
return res.json({amount})
})
Request insomnia: localhost:3003/consultclients?amount=10
I tried with a method that I used to search for an id, but I don't think it's the right method to use, even though it works:
server.get('/consultclients/:amount', (req,res) =>{
let amount = req.params.amount;
return res.json({amount})
})
Request insomnia: localhost:3003/consultclients/10