[object Object]

← back to Stars of Design

sod GET /sitemap.txt — plain-text sitemap (Google+Bing supported). Also removed duplicate /healthz stub that was overshadowed. 50/50.

9136d4a6ae2c3f211f882fdc288c138fbeaa33d4 · 2026-05-13 07:49:15 -0700 · Steve Abrams

Files touched

Diff

commit 9136d4a6ae2c3f211f882fdc288c138fbeaa33d4
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed May 13 07:49:15 2026 -0700

    sod GET /sitemap.txt — plain-text sitemap (Google+Bing supported). Also removed duplicate /healthz stub that was overshadowed. 50/50.
---
 routes/public.js | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/routes/public.js b/routes/public.js
index 5fc3b7e..255e4b6 100644
--- a/routes/public.js
+++ b/routes/public.js
@@ -562,6 +562,35 @@ router.get('/sitemap.xml', async (req, res, next) => {
   } catch (e) { next(e); }
 });
 
-router.get('/healthz', (req, res) => res.type('text').send('ok'));
+// /sitemap.txt — plain-text Google+Bing-supported sitemap. Mirrors asim
+// /sitemap.txt. Pulls URLs from /sitemap.xml on the fly (cheap, fetches
+// only the local route via in-process call to the XML generator below).
+router.get('/sitemap.txt', async (req, res, next) => {
+  try {
+    const base = 'https://starsofdesign.com';
+    const all = data.load();
+    const [firms, clients] = await Promise.all([
+      firmsLib.listFirms({ limit: 1000 }),
+      clientsLib.listClients({ limit: 1000 }),
+    ]);
+    const urls = [
+      `${base}/`,
+      `${base}/designers`,
+      `${base}/firms`,
+      `${base}/clients`,
+      `${base}/feed`,
+      `${base}/videos`,
+      `${base}/about`,
+      `${base}/submit`,
+      `${base}/privacy`,
+      `${base}/terms`,
+      ...all.map((d) => `${base}/designers/${d.slug}`),
+      ...firms.map((f) => `${base}/firms/${f.slug}`),
+      ...clients.map((c) => `${base}/clients/${c.slug}`),
+    ];
+    res.setHeader('Cache-Control', 'public, max-age=3600');
+    res.type('text/plain').send(urls.join('\n') + '\n');
+  } catch (e) { next(e); }
+});
 
 module.exports = router;

← ef12c2c sod /healthz Cache-Control: no-store (parity with asim)  ·  back to Stars of Design  ·  sod smoke +2 /sitemap.txt assertions. 52/52. 920bdd7 →