Skip to content

Default favicon.ico in Loopback #1827

Closed

Description

@pwwolf

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.

Activity

  1. self-assigned this
    on Nov 19, 2015
  2. jannyHou commented on Nov 20, 2015

    @jannyHou
    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.

  3. jannyHou commented on Nov 20, 2015

    @jannyHou
    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?

  4. bajtos commented on Nov 20, 2015

    @bajtos
    Member

    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?

  5. superkhau commented on Nov 23, 2015

    @superkhau
    Contributor

    ...disable the default StrongLoop favicon...

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

  6. zanemcca commented on Nov 25, 2015

    @zanemcca

    +1 for no icon

  7. bajtos commented on Nov 27, 2015

    @bajtos
    Member

    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.

  8. bajtos commented on Nov 27, 2015

    @bajtos
    Member
  9. pwwolf commented on Nov 30, 2015

    @pwwolf
    Author

    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)
    
  10. removed their assignment
    on Dec 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions