This is a really basic question, but I'm trying to change the favicon of my node.js/Express app with
app.use(express.favicon(__dirname + '/public/images/favicon.ico'));
and I'm still getting the default favicon. This is in my app.configure
function, and yes, I've verified that there is a favicon.ico
in the /public/images/favicon.ico
.There's nothing about a favicon.ico
in the console, either, which leads me to believe that this line of code is being ignored. Everything else in the function (setting port, setting views directory, setting template engine. etc.) seems to be working fine, so why would this line of code not be executing?
What I tried
- Emptying browser cache
- Restarting Terminal and running
node app.js
again
- Adding
{ maxAge: 2592000000 }
, as described here
Thanks in advance.
Update: I got it to work. See my answer below for more information.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…