aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorPjotr Prins2023-08-10 14:16:56 +0200
committerPjotr Prins2023-08-10 14:16:56 +0200
commit4720feda6419ab3ceb6332ceb37ee214a0274e54 (patch)
tree3ab5f2f3b3cf82c52a1cf40ca6e983ee5c5658a5 /web
parent3d54c221d0c70c1bf727148642546130cb15a19a (diff)
downloadgn-guile-4720feda6419ab3ceb6332ceb37ee214a0274e54.tar.gz
Some minor refactoring
Diffstat (limited to 'web')
-rwxr-xr-xweb/webserver.scm12
1 files changed, 6 insertions, 6 deletions
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")