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
step 0: add below code to app.js or index.js
app.use("/favicon.ico", express.static('public/favicon.ico'));
step 1: download icon from here https://icons8.com/ or create your own
step 2: go to https://www.favicongenerator.com/
step 3: upload the downloaded icon.png file > set 16px > create favicon > download
step 4: go to downloads folder, you'll find [.ico file], rename it as favicon.ico
step 5: copy favicon.ico in public directory you created
step 6: add below code to your .pug file under head tag, below title tag
step 7: save > restart server > close browser > reopen browser > favicon appears
NOTE: you can use name other than favicon,
but make sure you change the name in code and
in the public folder.