[object Object]

← back to Designerlookbooks

Add root /favicon.{ico,svg} route (static is mounted under /static, so browser /favicon.ico 404'd)

a809a85e6b55b76b6cd5f3c78e9784e2bce17399 · 2026-05-31 18:47:21 -0700 · Steve

Files touched

Diff

commit a809a85e6b55b76b6cd5f3c78e9784e2bce17399
Author: Steve <steve@designerwallcoverings.com>
Date:   Sun May 31 18:47:21 2026 -0700

    Add root /favicon.{ico,svg} route (static is mounted under /static, so browser /favicon.ico 404'd)
---
 server.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/server.js b/server.js
index de3be0b..22601b8 100644
--- a/server.js
+++ b/server.js
@@ -24,6 +24,8 @@ const DATA = JSON.parse(fs.readFileSync(path.join(__dirname, 'data', 'products.j
 
 const app = express();
 
+
+app.get(['/favicon.ico','/favicon.svg'], (req, res) => res.sendFile(require('path').join(__dirname, 'public', req.path.slice(1))));
 app.use((_req, res, next) => {
   res.set('X-Content-Type-Options', 'nosniff');
   res.set('X-Frame-Options', 'SAMEORIGIN');

← 16c8591 Add per-site favicon (kills /favicon.ico 404)  ·  back to Designerlookbooks  ·  Scrub residual vendor names from products.json (title/vendor 57f08bb →