Comments (4)
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.
👍 any guess?
from serve-favicon.
@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.
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)
- Purpose HOT 3
- Performance HOT 2
- where do i get the favicon icon ? HOT 1
- Support Requirement for Multiple Favicons HOT 4
- doc typo HOT 1
- serving different favicon for different pages HOT 1
- If no favicon present, should just return a 404 HOT 13
- Possible to use location outside of your repo? HOT 4
- Can't see favicon when using Microsoft Edge HOT 2
- Vary favicon by domain HOT 4
- Doubts on res._headers HOT 3
- Favicon not showing when running server with long context path. HOT 5
- How to use png favicon files? HOT 1
- how to add different favicon for different routers? HOT 3
- serve-favicon vulnerable to RegEx Denial of Service attack HOT 1
- Favicon is not showing HOT 5
- Can't run express js server app on my local host:3000 HOT 4
- Feature Request: Serve icon based on host mapping HOT 2
- Doesn't work with Chrome HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serve-favicon.