I recently started working in Node.js and in the app.js file there is this line:
app.use(express.favicon());
Now, how do I set up my own cu
Install express-favicon
middleware:
npm install express-favicon --save
Use it like this:
const favicon = require('express-favicon');
app.use(favicon(__dirname + 'favicon.ico'));
The code listed below works:
var favicon = require('serve-favicon');
app.use(favicon(__dirname + '/public/images/favicon.ico'));
Just make sure to refresh your browser or clear your cache.