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 ?? {}); %> +
- +
+ json-server + README +
+
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 <% } %> + + + <% }) %> <% } %> +
+ + + +