diff options
Diffstat (limited to 'web')
-rwxr-xr-x | web/webserver.scm | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/web/webserver.scm b/web/webserver.scm index 537fad5..bb6412d 100755 --- a/web/webserver.scm +++ b/web/webserver.scm @@ -135,10 +135,14 @@ (string-replace-substring str " " "_") ) -(define (get-expanded-taxon id) +(define (get-expanded-taxon-meta id) "Get information on a specific species, e.g. mouse" - #f - ) + `(("info" . ,id) + ("doc" . ,(mk-doc id)) + ("meta" . ,(mk-meta id)) + ("data" . ,(mk-rec id)) + ("up" . ,(mk-meta "species")) + )) (define (get-expanded-species) "Here we add information related to each species" @@ -240,6 +244,10 @@ (render-json get-version)) (('GET "doc" "species.html") (render-doc "doc" "species.html" (get-species-meta))) + (('GET "doc" taxon) + (match (string->list taxon) + [(name ... #\. #\h #\t #\m #\l) + (render-doc "doc" taxon (get-expanded-taxon-meta (list->string name)))])) (('GET "doc" path ... page) ; serve documents from /doc/ (render-doc path page)) (('GET "species.json") @@ -251,7 +259,7 @@ (('GET id) (let ([names (get-species-shortnames (get-expanded-species))]) (match (string->list id) - [(name ... #\. #\j #\s #\o #\n) (render-json (list->string name))] + [(name ... #\. #\m #\e #\t #\a #\. #\j #\s #\o #\n) (render-json (get-expanded-taxon-meta (list->string name)))] [rest (render-json "WIP")]))) (_ (not-found (request-uri request))) )) |