Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

serving favicon.ico from node.js

I have built a small node server using express and I want to serve index.html which contains angular app. How ever the browser sends GET request for favicon.ico. I have installed serve-favicon, however still it looks for physical file. Is there a way to override it? or from where can I find such file

like image 879
li-raz Avatar asked Apr 06 '26 12:04

li-raz


1 Answers

The recommended way is actually just to use a link tag in your index.html:

<link rel="icon" href="/img/favicon.png">

Just change the href to link to an img in your public folder and you're good to go.

http://www.w3.org/2005/10/howto-favicon

like image 83
Ryan Avatar answered Apr 09 '26 04:04

Ryan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!