-
Notifications
You must be signed in to change notification settings - Fork 355
dev: Fix 404 message for missing favicon.ico #184
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
Conversation
* Make a symlink (soft) to favicon.ico for dev to remove the error of not finding the ico. Affects only dev and /images path should be used for code refs...ignore any "no newline at end of file" or it will break * Now it will show in dev under Nix... Win7+ or greater is probably required for this to show as found since it handles file symbolic links...XP and before only do dirs.
|
Shell Session log: $ node app.js
Failed to load c++ bson extension, using pure JS version
js-bson: Failed to load c++ bson extension, using pure JS version
GitHub client authenticated
GET / 200 1239ms
GET /css/common.css 200 143ms
GET /css/bootstrap-custom.css 200 153ms
GET /favicon.ico 200 73ms
GET /favicon.ico 304 71ms
GET / 200 337ms
GET /css/bootstrap-custom.css 304 134ms
GET /css/common.css 304 141ms
GET /favicon.ico 304 69ms
GET /?library=true 200 225ms
GET /css/bootstrap-custom.css 304 136ms
GET /css/common.css 304 140ms
GET /favicon.ico 304 69ms
GET /groups 200 219ms
GET /css/bootstrap-custom.css 304 134ms
GET /css/common.css 304 139ms
GET /favicon.ico 304 70ms
...instead of: $ node app.js
Failed to load c++ bson extension, using pure JS version
js-bson: Failed to load c++ bson extension, using pure JS version
GitHub client authenticated
GET / 200 1209ms
GET /css/common.css 200 139ms
GET /css/bootstrap-custom.css 200 152ms
GET /favicon.ico 404 73ms
GET /?library=true 200 221ms
GET /css/common.css 304 136ms
GET /css/bootstrap-custom.css 304 142ms
GET /groups 200 215ms
GET /css/bootstrap-custom.css 304 133ms
GET /css/common.css 304 139ms
...POINT OF INTEREST: Interesting that node.js hides future 404 messages. |
|
More curious... why don't we use the favicon middleware (linked SO as it links for each express version)? |
Where do you get 404's? I haven't had one... |
I'm -1 on using another middleware for something so minor. It will only slow things down. Apparently Express 3 (we are on 3.5.1) has this backed in: http://www.senchalabs.org/connect/favicon.html |
This is what I would use. Either that or actually put the |
I just get it. Might be a Nix thing.
WOW! That's a lot of code to put in for something this small. Who knew? ;) I assume that goes in
That could be option 2 but it will make this pr be dependent upon #173 instead (and any future ones referenced if they pop up before merge) of no dependencies. :) My concern would be if we ever migrate to a newer express will that code break or is it just smoother to do Option 1 in this pr or Option 2 suggested from Cletus? My usual suggestion is lets keep things on the KISS principle... so either of these works for me. I have a bazillion tabs open sometimes so it's nice to know what is what. |
No it's a one-liner. See b5877be.
Many things will break when we finally move to Express 4.x. This will be the least of our worries. |
|
For future reference, when we do migrate to Express 4.x, migration would basically change to this instead (per serve-favicon, which is actually for both 3.x and 4.x): var favicon = require('serve-favicon');
app.use(favicon('public/images/favicon.ico')); |
/imagespath should be used for code refs and edits... ignore any "no newline at end of file" messages or it will break