How can I replace the default favicon in an slc loopback generated webapp? How can I replace the default favicon in an slc loopback generated webapp? express express

How can I replace the default favicon in an slc loopback generated webapp?


Set the path to your custom favicon in the server/middleware.json:

{  "initial:before": {    "loopback#favicon": {      "params": "path/to/your/favicon.ico"    }  },  …

We had problems setting the paths just in the HTML, on some reloads the default StrongLoop favicon was still popping up. This configuration helped.

PS: If your favicon.ico is in the root of the client directory, use this path: "$!../client/favicon.ico"


Some browsers aggressively cache favicons. Try navigating to <yourhost>/favicon.ico and see if it shows the correct file, to make sure it isn't a client-side cache issue.


The default favicon is configured in server/middleware.json:

{  "initial:before": {    "loopback#favicon": {}  },

Please note it's in the initial:before phase which comes before routes phase (app.use). You should modify server/middleware.json for your purpose.