Am I missing something? Here is what I have:
var express = require('express');
var favicon = require('serve-favicon');
var path = require('path');
var app = express();
app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app.use('/api', require('./routes/api'));
app.listen(3000);
My favicon is located as specified in the public folder and the same name. I have some other routes setup separately in a file. The favicon doesn't appear to be working, I must be missing something.
The browser might have cached an older favicon. You can force the browser to refresh the cache by adding a version to the new favicon like so:
<link rel="icon" href="favicon.ico?v=1.1">
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