[object Object]

← back to Fabricut Landing

SEO: dynamic sitemap on public + noindex robots on internal

935a208d923670a68289c0fc38411f0b336c9a34 · 2026-08-20 11:02:31 -0700 · Steve Abrams

Files touched

Diff

commit 935a208d923670a68289c0fc38411f0b336c9a34
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu Aug 20 11:02:31 2026 -0700

    SEO: dynamic sitemap on public + noindex robots on internal
---
 server.js | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/server.js b/server.js
index a10ce39..e86fea3 100644
--- a/server.js
+++ b/server.js
@@ -122,6 +122,15 @@ app.post('/api/inquiry', (req, res) => {
 // robots — public site indexes; internal-only routes/pages don't exist here.
 app.get('/robots.txt', (_req, res) => res.type('text/plain').send('User-agent: *\nAllow: /\nSitemap: https://fabricut.designerwallcoverings.com/sitemap.xml\n'));
 
+// Dynamic sitemap — home + every PDP, always current (rebuilt from SNAP on each request).
+app.get('/sitemap.xml', (_req, res) => {
+  const base = 'https://fabricut.designerwallcoverings.com';
+  const urls = [`${base}/`, ...SNAP.products.map(p => `${base}/product/${p.handle}`)];
+  res.type('application/xml').send(
+    `<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n`
+    + urls.map(u => `<url><loc>${u}</loc></url>`).join('\n') + `\n</urlset>\n`);
+});
+
 app.use(express.static(path.join(__dirname, 'public')));
 app.get('/product/:handle', (_req, res) => res.sendFile(path.join(__dirname, 'public', 'product.html')));
 

← 5048cfe Public site hardening (Cody red-team FIX FIRST): remove vend  ·  back to Fabricut Landing  ·  chore: v1.0.0 — go-live (session close) aa2887a →