From 6869a03646c56a88c635c7178111da678d587379 Mon Sep 17 00:00:00 2001 From: typicode Date: Mon, 9 Mar 2026 19:38:15 +0100 Subject: [PATCH] redesign: cleaner index page with system sans-serif font and indigo hover --- views/index.html | 176 +++++++++++++++++++++++++++++------------------ 1 file changed, 109 insertions(+), 67 deletions(-) diff --git a/views/index.html b/views/index.html index ed311c493..c872356b6 100644 --- a/views/index.html +++ b/views/index.html @@ -1,95 +1,137 @@ - + + JSON Server + <% const resources = Object.entries(it.data ?? {}); %> +
- + +
Available REST resources from db.json.
-
-

- ✧*。٩(ˊᗜˋ*)و✧*。 -

- <% if (Object.keys(it.data).length===0) { %> -

No resources found in JSON file

- <% } %> <% Object.entries(it.data).forEach(function([name]) { %> - - <% }) %> -
+ +
Resources
+ +
+ <% if (resources.length === 0) { %> + No resources in db.json. + <% } else { %> <% resources.forEach(function([name, value]) { const isCollection = + Array.isArray(value); %> + + /<%= name %> + + <% if (isCollection) { %> <%= value.length %> items <% } else { %> object <% } %> + + + <% }) %> <% } %> +
+ + + +