From 4720feda6419ab3ceb6332ceb37ee214a0274e54 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Thu, 10 Aug 2023 14:16:56 +0200 Subject: Some minor refactoring --- web/webserver.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'web') diff --git a/web/webserver.scm b/web/webserver.scm index bb6412d..771bebd 100755 --- a/web/webserver.scm +++ b/web/webserver.scm @@ -63,7 +63,7 @@ "Create a meta URL for the API path" (mk-url path ".meta.json")) -(define (mk-rec path) +(define (mk-data path) "Create a JSON URL for the API path" (mk-url path ".json")) @@ -140,7 +140,7 @@ `(("info" . ,id) ("doc" . ,(mk-doc id)) ("meta" . ,(mk-meta id)) - ("data" . ,(mk-rec id)) + ("data" . ,(mk-data id)) ("up" . ,(mk-meta "species")) )) @@ -191,10 +191,10 @@ "Return a list of short names and expand them to URIs" (map (lambda r (let ([shortname (assoc-ref (car r) "shortName")]) - (cons shortname (mk-rec shortname)))) recs) + (cons shortname (mk-data shortname)))) recs) ) -(define (get-species-rec) +(define (get-species-data) (list->vector (get-expanded-species))) (define (get-species-meta) @@ -202,7 +202,7 @@ `(("info" . "Get information on species by visiting the data link or one of the individual links") ("doc" . ,(mk-doc "species")) ("meta" . ,(mk-meta "species")) - ("data" . ,(mk-rec "species")) + ("data" . ,(mk-data "species")) ("up" . ,(string-append (prefix) "/")) ("meta-links" . ,(get-species-meta2 recs)) ("links" . ,(get-species-links recs))))) @@ -251,7 +251,7 @@ (('GET "doc" path ... page) ; serve documents from /doc/ (render-doc path page)) (('GET "species.json") - (render-json (get-species-rec))) + (render-json (get-species-data))) (('GET "species.meta.json") (render-json (get-species-meta))) (('GET "species") -- cgit v1.2.3