Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

254
Views
Favicon not showing locally on express

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.

about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

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">
about 4 years ago · Santiago Trujillo Report

0

This answers your question.

It says:

  1. Go to http://localhost:3000/favicon.ico
  2. Refresh the page.
  3. Restart the browser.
about 4 years ago · Santiago Trujillo Report

0

Check what is in the <head> section of the document. While a browser may implement a default favicon.ico behavior, it can also be controlled from the <head> section by either telling the browser what file/path you want it to fetch the favicon from, what type of file it is or that you don't want it to look for a favicon at all.

Here are two other references on the topic that cover some of the specifics:

Add Favicon to Website

Necessary to add link tag for favicon.ico?

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!