-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serve a unique favicon.ico per project #62
Comments
No code to merge yet, because I like being able to install // lib/server.js
const express = require('express')
const cors = require('cors')
...
const identicon = require('identicon')
const favicon = require('serve-favicon')
var server = module.exports = express()
server.use(cors())
// Create unique favicon from the current working directory
var faviconPNG = identicon.generateSync({id: process.cwd(), size: 16})
server.use(favicon(faviconPNG))
... |
Looks good, but is there a check to serve an existing favicon if one exists? |
Right, obviously an actual favicon.ico would take priority. I suppose that would mean putting |
So this is just for development? Or do you also intend to kick out a default favicon in the build process if none exists? |
I was just thinking of during development, to help me keep my tabs straight. Do you think people would want a defacto favicon in the built version? |
Probably not. Just clarifying your intent. :) |
Oh boy! My identicon PR already is merged and on npm! :) |
How seriously do we take IE support? Apparently some browser STILL doesn't accept PNG favicons. There's a Edit: Correction! I have maligned IE unjustly. It does take PNG favicons. It is just very VERY stubborn about caching favicons. (Had to delete the browser history to uncache them.) |
Edit: Ignore my original grumpy old man statement. Feel free to discuss the feature / concept in this thread and critique the implementation in the pull request. Apparently in the grand scale of things that is supposed to make life less confusing. (grump grump grump) Is there not a way to turn an existing issue into a pull request? I feel like the discussion should move to the pull request #63 but it's annoying that it's gonna fragment the conversation thread by doing that. |
Pretty sure you can still do it with https://hub.github.com/ |
Oh my. Googling that led to some loooong discussion threads. It sounds like the recommended practice is to separate concerns: issues for the bug / feature itself, pull-requests for the implementation details. Now I know, let's go with the flow. :) |
Serve a unique favicon per project! Solves issue #62
Merged in #63 |
Browser's tend to cache the favicon, and so whenever I start a new project and am serving on http://localhost:3000 it will use the icon from some other project I'm working on. What's more, Chrome will add 404 errors for
favicon.ico
to the network request log and the console, and my heart rate goes up whenever Chrome starts printing red text in the console. This is one of those little bitty irksome things that bothers me just enough over time that I am resolved thatjus serve
be able to invent a newfavicon.ico
on the fly and serve it for projects that don't have a favicon.My plan is to use identicon to generate the favicons, and then make an express middleware that can plugged into jus. This page shows examples what identicons look like:
The text was updated successfully, but these errors were encountered: