Express GET route is not recognized

I have this route:

// FIXME: This rotes has a unknown bug
router.get('/unverified', async (req, res) => {
  try {
    const unverifiedUsers = await User.find(
      { is_verified: false, is_admin: false },
      { name: 1, code: 1, email: 1, gender: 1 }
    );
    return res.status(200).json(unverifiedUsers);
  } catch (error) {
    return res.status(400).send({ error });
  }
});

And I use it like this:

app.use('/api/users', userRoute);

Everytime I go to http://localhost:5000/api/users/unverified I got this:

{
    "error": {
        "stringValue": "\"unverified\"",
        "kind": "ObjectId",
        "value": "unverified",
        "path": "_id",
        "reason": {}
    }
}

It’s strange to me because the other routes work perfectly and that error doesn’t give me a reason.

159 thoughts on “Express GET route is not recognized”

  1. Everything wrote was actually very reasonable.

    However, think on this, suppose you were to create a killer headline?
    I ain’t suggesting your information isn’t solid., but suppose you added a title to maybe get folk’s attention? I
    mean Express GET route is not recognized – JavaScript Help
    is kinda vanilla. You might glance at Yahoo’s home page and watch how they write article headlines to grab people interested.

    You might add a related video or a related pic or
    two to get people interested about everything’ve got to say.
    Just my opinion, it might make your posts a little bit more interesting.

    Reply
  2. Hi would you mind sharing which blog platform you’re using?
    I’m going to start my own blog soon but I’m having a difficult time selecting between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your layout seems different then most blogs
    and I’m looking for something completely unique.
    P.S Apologies for being off-topic but I had to ask! http://antiibioticsland.com/Cipro.htm

    Reply
  3. Hi there I am so happy I found your web site, I really found you by error, while I was looking on Askjeeve for something else, Regardless I am here now and would just
    like to say kudos for a remarkable post and a all round exciting blog (I also love the
    theme/design), I don’t have time to look over it all at the moment but I have book-marked it
    and also included your RSS feeds, so when I have time I will be back
    to read much more, Please do keep up the awesome work. http://harmonyhomesltd.com/Ivermectinum-during-pregnancy.html

    Reply
  4. Hi there! I know this is kind of off topic but I was wondering if you knew where I could get a captcha plugin for my comment form? I’m using the same blog platform as yours and I’m having trouble finding one? Thanks a lot!|

    Reply
  5. Minecraft Premium Satın Al sizler için en uygun fiyatlarla hesap satışı yapmaktayız. 2018 Tarihinden itibaren %100 müşteri memnuniyeti ile sektörede 1 NUMARAYIZ. Sürekli güncellenen döviz kurlarından dolayı hesap fiyatlarının oldukça arttığı bu dönemde siz değerli müşterilerimize her zaman en uygun ve en güvenilire Minecraft Premium ve diğer hizmetlerimizi sunmaktayız. Sağladığımız hizmet sayesinde 2018 tarihinden itibaren 10.000’den fazla müşterimize 25.000’den fazla hesap satmış bulunmaktayız. %100 memnuniyet ile ilerlediğimiz bu yolda elimizden geldiğinden Türkiye’nin en uygun ve en güvenilir Minecraft Premium Hesap sağlayıcısıyız. Minecraft Premium Satın Al Mobil Ödeme dahil bir çok ödeme yöntemi ile 7/24 saat otomatik teslimat ile beklemeden en uygun fiyata Minecraft Premium Hesap sahibi olabilirsiniz. Mobil Ödeme ile dilerseniz fatuarlı dilerseniz faturasız hattınız ile Minecraft Premium Hesabı satın alabilir, oyunun keyfini sürebilirsiniz. Sürekli güncel tutulan stoklarımız sayesinde hiç stok derdi olmadan istediğin paketteki hesaba hemen sahip olabilirsin.

    Reply

Leave a Comment