Coder Social home page Coder Social logo

Comments (4)

dougwilson avatar dougwilson commented on July 30, 2024 1

You can't. See the module's description including the link to Wikipedia regarding what can be done. Web browsers will automatically make a request to GET /favicon.ico, so you need to serve the icon up at that address for the browser to get it. If you don't want to keep the icon file on your local file system, you can always use the request module or similar to fetch the icon on your server, and then provide the Buffer object to this module as the icon.

from serve-favicon.

mauricionr avatar mauricionr commented on July 30, 2024

👍 any guess?

from serve-favicon.

hadifarnoud avatar hadifarnoud commented on July 30, 2024

@dougwilson I tried doing that and failed. Asked a few people too but we were not able to get it to work.

can you kindly provide an example? I had to write the whole thing without your package but would be nice to switch

from serve-favicon.

dougwilson avatar dougwilson commented on July 30, 2024

Something like this:

module.exports = createApp (cb) {
  var app = express();

  // ... do setup / add things

  request({ method: 'GET', url: 'http://example.com/favicon.ico', encoding: null}, function (err, res, body) {
    if (err) return cb(err);

    app.use(serveFavicon(body));

    // .. continute to setup app

    cb(null, app);
  });
};

from serve-favicon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.