← back to Stars of Design
starsofdesign: GET /api — JSON discovery doc for public API endpoints (stats/comments/like/comment) + PII policy notes. Mirrors asim /api pattern.
6e94cda08627952f20598185f3d593c55dd53448 · 2026-05-12 20:05:44 -0700 · Steve Abrams
Files touched
Diff
commit 6e94cda08627952f20598185f3d593c55dd53448
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Tue May 12 20:05:44 2026 -0700
starsofdesign: GET /api — JSON discovery doc for public API endpoints (stats/comments/like/comment) + PII policy notes. Mirrors asim /api pattern.
---
routes/public.js | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/routes/public.js b/routes/public.js
index 6740630..d3d64bd 100644
--- a/routes/public.js
+++ b/routes/public.js
@@ -320,6 +320,25 @@ router.get('/feed', async (req, res, next) => {
} catch (e) { next(e); }
});
+// /api — JSON discovery doc for sod public/api endpoints. Mirrors asim.
+router.get('/api', (_req, res) => {
+ res.json({
+ name: 'Stars of Design API',
+ base: 'https://starsofdesign.com',
+ endpoints: {
+ 'GET /api/stats': 'Aggregate counts (designers/firms/claimed/links/likes/comments/candidates)',
+ 'GET /api/clients/:id/comments': 'Comments on a DW client profile (chronological)',
+ 'POST /api/clients/:id/like': 'Toggle like on a DW client (anonymous ID via cookie)',
+ 'POST /api/clients/:id/comment': 'Post a comment on a DW client (name + body, optional email)',
+ },
+ notes: [
+ 'Profiles are city + state only; no street addresses, no phone numbers (PII policy).',
+ 'Likes + comments use anonymous browser IDs — no account required.',
+ 'Profile content is editorial; designers may submit edits via /submit.',
+ ],
+ });
+});
+
router.get('/api/clients/:id/comments', async (req, res, next) => {
try {
const id = parseInt(req.params.id, 10);
← 9d16cb3 starsofdesign: smoke test harness — test/smoke.js (zero deps
·
back to Stars of Design
·
starsofdesign: smoke — add /api discovery doc check (+2 asse a32feca →