Express get api with params
<p>I'm new to express API. I have an API with http GET and I'd like to get data from mongodb that matches to certain criteria. Here is my mongodb documents looks like : </p>

<p><code>{value:"24", category:"low"} {value:"30", category:"middle"}, {value:"23", category:"low"}</code></p>

<p>And my code in the server side looks like this : </p>

<pre><code>`router.route('/temps')
.get(function(req,res){
    Temp.find(function(err, temps){
      if(err){
        res.send(err)
      } else {
        var category = req.params.category
        console.log(temps)
        res.format({
          json: function(){
            res.json(temps)
          },
          html: function(){
          res.render('temps', {
                  title: 'All temps',
                  temps: temps
              });
          },
        });
      }
    })
  })`
</code></pre>

<p>I wanna get all values where the category is <code>low</code> with query like this : <code>/temps?category=low</code>. How can I modify the codes above? Thanks for the help.</p>