added ability to set a custom favicon
This commit is contained in:
parent
fdeb2a45e7
commit
4d7c8a2c7d
|
@ -344,8 +344,16 @@ async.waterfall([
|
||||||
app.get('/favicon.ico', function(req, res)
|
app.get('/favicon.ico', function(req, res)
|
||||||
{
|
{
|
||||||
res.header("Server", serverName);
|
res.header("Server", serverName);
|
||||||
var filePath = path.normalize(__dirname + "/../static/favicon.ico");
|
var filePath = path.normalize(__dirname + "/../static/custom/favicon.ico");
|
||||||
|
res.sendfile(filePath, { maxAge: exports.maxAge }, function(err)
|
||||||
|
{
|
||||||
|
//there is no custom favicon, send the default favicon
|
||||||
|
if(err)
|
||||||
|
{
|
||||||
|
filePath = path.normalize(__dirname + "/../static/favicon.ico");
|
||||||
res.sendfile(filePath, { maxAge: exports.maxAge });
|
res.sendfile(filePath, { maxAge: exports.maxAge });
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
//let the server listen
|
//let the server listen
|
||||||
|
|
Loading…
Reference in New Issue