Why in my express app(url shortener), there is always a get request to '/favicon.ico', What is this[SOLVED]

In my Url shortener app I have defined one get request as -

app.get('/:shortcode', function(req, res) {
  console.log("req.params is ",req.params)
//Code
});

No matter where I am making request either to home page (/), or any othet url(localhost:/new/anything),
it will automatically make this request(/favicon.ico) also.In console I find this in every case - req.params is { code: ‘favicon.ico’ }.
Can anyone explain the reason for this behaviour?

Hi, the favicon is the small icon you see in the tab, left of the title… depending on the user’s browser it may (or not) ask for that file… its an “aesthetical thing”.

2 choises: Serve it or ignore it :slight_smile:

1 Like

Ok…ok …now I understand! Thanks :slight_smile: