From 0e7151f975e7998124495f97d76d72cf3ea78316 Mon Sep 17 00:00:00 2001 From: "Stuart P. Bentley" Date: Sun, 27 Sep 2015 02:45:17 -0700 Subject: [PATCH] Simplify favicon hosting This is essentially what the old code did, but without using the deprecated connect-favicon middleware. The meta tag on pages is redundant, but it's still a good idea to keep it around (and maybe supplement it with tags that link to the icon in simpler, straightforward image formats like PNG). --- server.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/server.js b/server.js index bc1ea3501..f9f4d0d24 100644 --- a/server.js +++ b/server.js @@ -78,16 +78,6 @@ var app = express(); app.enable("strict routing"); app.set('port', args.argv['port'] || process.env.PORT || 8088); -/* - * I already include the following in the tag of my HTML documents: - * - * - * - * and if remove that line, browsers stop displaying my favicon, so I'm not sure what the - * following code is doing for me. TODO: Find out! - */ -app.use(express.favicon(path.join(sServerRoot, "./versions/images/current/favicon.ico"))); - /* * For more information about express.logger(): * @@ -133,6 +123,8 @@ app.use(function(req, res, next) { }); app.use(express.static(sServerRoot)); +/* Serve favicon at site root */ +app.use('/favicon.ico', express.static(path.join(sServerRoot, "versions/images/current/favicon.ico"))); app.use(slash()); var server = http.createServer(app).listen(app.get('port'), function() {