express.favicon()

9,117 views
Skip to first unread message

Rob Faraj

unread,
Mar 30, 2011, 6:28:00 PM3/30/11
to expre...@googlegroups.com
Can anyone help me figure out what express.favicon() actually does? 

I see this nifty light and dark blue favicon.ico in my browser after using this. How can I change it to be my nifty favicon.ico file? 

TJ Holowaychuk

unread,
Mar 30, 2011, 6:35:07 PM3/30/11
to expre...@googlegroups.com
it's a fast path to a favicon, typically one has static() lower in the stack so that routes can intercept if needed, however this is rarely needed for a favicon. favicon(__dirname + '/path/to/favicon.ico')

-- 
TJ Holowaychuk

On Wednesday, March 30, 2011 at 3:28 PM, Rob Faraj wrote:

Can anyone help me figure out what express.favicon() actually does? 

I see this nifty light and dark blue favicon.ico in my browser after using this. How can I change it to be my nifty favicon.ico file? 

--
You received this message because you are subscribed to the Google Groups "Express" group.
To post to this group, send email to expre...@googlegroups.com.
To unsubscribe from this group, send email to express-js+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/express-js?hl=en.

TJ Holowaychuk

unread,
Mar 30, 2011, 6:35:31 PM3/30/11
to expre...@googlegroups.com

Rob Faraj

unread,
Mar 30, 2011, 7:37:06 PM3/30/11
to expre...@googlegroups.com
Thanks TJ. I should have looked in connect all along.

If anyone else has the same question, here is what I put to get it to work. The maxAge is a cache-control directive in milliseconds.

app.use(express.favicon(__dirname + '/public/favicon.ico', { maxAge: 2592000000 }));
Reply all
Reply to author
Forward
0 new messages