I would like to know what express.favicon() does. I seared and could not get the reasoning.
can any one explain me on this.
app.use(express.favicon());
I read some link that this command will do a ignore of GET/favicon.ico. I am looking for understanding more about this like?where is the function: express.favicon() defined and all those information, I did checked in the expresss website could not find the declaration/definition of this function
If you are using Express. static to serve a folder, just put the favicon. ico file in the root of that folder and it will be served when the browser requests it. There's no need to add a link tag to your html or a special middleware route in the application code.
A favicon is a small size file as known as website icon, tab icon, URL icon or bookmark icon. The serve-favicon module is used to serve favicon from the NodeJS server.
Originally, the favicon was a file called favicon. ico placed in the root directory of a website. It was used in Internet Explorer's favorites (bookmarks) and next to the URL in the address bar if the page was bookmarked.
It defines a favicon for your application. Passing no path to a favicon will serve up the express favicon by default.
As far as I can tell, it loads the /favicon.ico file from your site (like it would if you have the static handler loaded) but then caches it.
So, the advantage of using this over just the static handler is that it caches it more.
http://www.senchalabs.org/connect/favicon.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With