[object Object]

← back to Stars of Design

Keep Stars of Design sitemaps available without database

58c5d3153ef8497edefa09115099e4ee2ff21dca · 2026-09-10 10:06:40 -0700 · Steve Abrams

Files touched

Diff

commit 58c5d3153ef8497edefa09115099e4ee2ff21dca
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu Sep 10 10:06:40 2026 -0700

    Keep Stars of Design sitemaps available without database
---
 routes/public.js | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/routes/public.js b/routes/public.js
index e1bbb0c..1fe07dd 100644
--- a/routes/public.js
+++ b/routes/public.js
@@ -715,9 +715,12 @@ router.get('/sitemap.xml', async (req, res, next) => {
     const base = 'https://starsofdesign.com';
     const all = data.load();
     const today = new Date().toISOString().slice(0, 10);
+    // The directory database is an enrichment tier. Sitemap generation must
+    // remain available when that optional local socket is unavailable (for
+    // example, a deploy host without the stevestudio2 peer role).
     const [firms, clients] = await Promise.all([
-      firmsLib.listFirms({ limit: 1000 }),
-      clientsLib.listClients({ limit: 1000 }),
+      firmsLib.listFirms({ limit: 1000 }).catch(() => []),
+      clientsLib.listClients({ limit: 1000 }).catch(() => []),
     ]);
     const urls = [
       { loc: `${base}/`,          priority: '1.0', changefreq: 'weekly' },
@@ -766,8 +769,8 @@ router.get('/sitemap.txt', async (req, res, next) => {
     const base = 'https://starsofdesign.com';
     const all = data.load();
     const [firms, clients] = await Promise.all([
-      firmsLib.listFirms({ limit: 1000 }),
-      clientsLib.listClients({ limit: 1000 }),
+      firmsLib.listFirms({ limit: 1000 }).catch(() => []),
+      clientsLib.listClients({ limit: 1000 }).catch(() => []),
     ]);
     const urls = [
       `${base}/`,

← 32994ed Allow AdSense through public CSP  ·  back to Stars of Design  ·  (newest)