title: Sequelize model querying- Why don't both routes work at same time?
body: <p>I am playing with some routes in Express, using Sequelize to create my models.
  I have two models that both work independently of one another. But I want them both to work at the same time. To someone experienced there is probably an obvious reason.</p>
  <p>My first route gets items by primary key:</p>
  <pre><code>router.get('/:id', async (req, res) =&gt; {
    try {
      const categoryData = await Category.findByPk(req.params.id)
      .then((result) =&gt; {
        res.status(200).json(result);
      });
  
    } catch (err) {
      res.status(500).json(err)
    }
  });
  </code></pre>
  <p>An example result of this query looks like:</p>
  <pre><code>{
    &quot;id&quot;: 1,
    &quot;category_name&quot;: &quot;Shirts&quot;
  }
  </code></pre>
  <p>My second route gets results by another parameter, category_name</p>
  <p>Here is this route:</p>
  <pre><code>router.get('/:category_name', async (req, res) =&gt; {
    try {
      const categoryData = await Category.findAll({
        where: {category_name: req.params.category_name}
      })
      .then((result) =&gt; {
        res.status(200).json(result);
      });
  
    } catch (err) {
      res.status(500).json(err)
    }
  });
  </code></pre>
  <p>and the results look like this:</p>
  <pre><code>[
    {
      &quot;id&quot;: 2,
      &quot;category_name&quot;: &quot;Shorts&quot;
    }
  ]
  </code></pre>
  <p>However, I can only use one route at a time. If both routes are turned on, only one or the other works.  Why??</p>