Skip to content

Default favicon.ico in Loopback #1827

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

Closed
pwwolf opened this issue Nov 19, 2015 · 8 comments
Closed

Default favicon.ico in Loopback #1827

pwwolf opened this issue Nov 19, 2015 · 8 comments

Comments

@pwwolf
Copy link

pwwolf commented Nov 19, 2015

This is a minor gripe, but I noticed that Loopback projects contain the same favicon.ico as strongloop.com. This is frustrating because in a browser with a lot of tabs, I can't distinguish which tab is my local server vs strongloop.com, where I usually have doc opened.

Personally I prefer not to even have a favicon set by default. The browser caches the favicon to localhost:3000, and then any node app I work on (loopback or not) contains the Strongloop icon until I forcibly delete the cache.

@jannyHou jannyHou self-assigned this Nov 19, 2015
@jannyHou
Copy link
Contributor

@pwwolf Thanks for your suggestion! We will see if there is any improvement to update the icon change faster. As a workaround you could probably load your app after setting the favicon.
And you can also customize your favicon by setting it in middleware.json, check our doc for details.
Another idea(not sure whether it works): you can try some watchify modules like this watchify example, it can watch and update changes in certain folders without restarting your server.

@jannyHou
Copy link
Contributor

Hey @superkhau @ritch @raymondfeng @bajtos, from the description above, some improvement regarding favicon might be need:) User has to clear cache every time to see the favicon change. The customized favicon(set from middleware.json) has the same problem. Any ideas about updating the favicon faster?

@bajtos
Copy link
Member

bajtos commented Nov 20, 2015

IIUC, the favicon is cached by the browser - I don't think we can do much here. See e.g this thread discussing the topic in Chrome context: https://productforums.google.com/forum/#!topic/chrome/zXlEW0ZFErY

The only solution I can think of is to disable the default StrongLoop favicon as suggested @pwwolf:

Personally I prefer not to even have a favicon set by default.

I don't have a strong opinion which way is better. @ritch @raymondfeng do you happen to remember why we added the default StrongLoop-branded favicon?

@superkhau
Copy link
Contributor

...disable the default StrongLoop favicon...

My vote goes to no icon to prevent issues like this from coming up again in the future.

@zanemcca
Copy link

+1 for no icon

@bajtos
Copy link
Member

bajtos commented Nov 27, 2015

I am proposing to keep loopback#favicon as it is for backwards compatibility, and modify slc loopback to scaffold a project that does not come with any favicon middleware.

@bajtos
Copy link
Member

bajtos commented Nov 27, 2015

@pwwolf
Copy link
Author

pwwolf commented Nov 30, 2015

I just realized one negative consequence of removing the favicon middleware. Since loopback records 404s to the console, there are errors with stack traces unavoidably shown in the console when the browser attempts to request the now-missing favicon.

Even though the error is benign, I'd rather deal with the default favicon than have to see the error messages.

Error: Cannot GET /favicon.ico
    at raiseUrlNotFoundError (/home/pw/lb/node_modules/loopback/server/middleware/url-not-found.js:15:17)
    at Layer.handle [as handle_request] (/home/pw/lb/node_modules/loopback/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/pw/lb/node_modules/loopback/node_modules/express/lib/router/index.js:312:13)
    at /home/pw/lb/node_modules/loopback/node_modules/express/lib/router/index.js:280:7
    at Function.process_params (/home/pw/lb/node_modules/loopback/node_modules/express/lib/router/index.js:330:12)
    at next (/home/pw/lb/node_modules/loopback/node_modules/express/lib/router/index.js:271:10)
    at /home/pw/lb/node_modules/loopback/node_modules/express/lib/router/index.js:618:15
    at next (/home/pw/lb/node_modules/loopback/node_modules/express/lib/router/index.js:256:14)
    at Function.handle (/home/pw/lb/node_modules/loopback/node_modules/express/lib/router/index.js:176:3)
    at router (/home/pw/lb/node_modules/loopback/node_modules/express/lib/router/index.js:46:12)

@jannyHou jannyHou removed the triaging label Nov 30, 2015
@jannyHou jannyHou removed their assignment Dec 8, 2015
@ritch ritch added the stale label Nov 18, 2016
@ritch ritch closed this as completed Nov 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants