Sails.jsapplication uses favicon icon by default. I want to replace him with mine, but I fought with him for several hours.
I tried to add a separate one favicon.jswith the following code in the config folder, but with no luck.
var favicon = require('static-favicon');
var path = require('path');
module.exports = {
express: {
customMiddleware: function(app){
console.log('loading favicon.');
app.use(favicon(path.join(__dirname, 'icon_fav.ico')));
app.use(function (req, res, next) {
console.log("installed customMiddleware is used");
next();
})
}
}
};
By the way, adding the next line in the presentation template will work in both Chrome and Fire Fox, but not in Safari (OSX), I don’t know why.
<link rel="icon" href="/img/icon_fav.png" type='image/png'>
Also tried putting /favicon.icounder the root of the web server.
In search of this, and no one seemed to ask before.
Can someone point me to a solution?
source
share