S
S
squadbrodyaga2020-11-12 19:32:27
Express.js
squadbrodyaga, 2020-11-12 19:32:27

Why does console.log(req.params) output favicon.ico?

Hello.
In general, with the help of req.params.id, I find out information from the address bar, but for some reason , favicon.ico
is displayed in my console , maybe someone has come across this garbage and knows what's wrong?

router.get('/:id', async (req, res) => {
    console.log(req.params.id);
})

5fad63441f7af941212758.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aetae, 2020-11-12
@squadbrodyaga

If you don't have an icon, the default browser tries to load the <сайт>/favicon.ico.
router.get('/:id', ...)listens to all requests of the view <сайт>/<что-то>and puts it <что-то>in id.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question