From ac059c92e1d678d8c4f5678fa2e14bc0110ffa11 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sat, 22 Jul 2023 14:53:58 +0200 Subject: Trying stuff --- gn3-guile/web/webserver.scm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/gn3-guile/web/webserver.scm b/gn3-guile/web/webserver.scm index db9eb62..08e2412 100755 --- a/gn3-guile/web/webserver.scm +++ b/gn3-guile/web/webserver.scm @@ -102,7 +102,11 @@ SELECT DISTINCT ?species WHERE { (define-values (names res) (sparql-species-meta)) (define table (get-rows names res)) (define recs '()) -(compile-species recs table) +(define h (compile-species recs table)) +(assoc "http://genenetwork.org/species_drosophila_melanogaster" h) +(assoc-ref h "http://genenetwork.org/species_drosophila_melanogaster") ;; note switch! +(define d (car h)) +(assoc-ref (list d) "http://genenetwork.org/species_drosophila_melanogaster") !# (define (sparql-species-meta) @@ -184,9 +188,11 @@ SELECT ?species ?p ?o WHERE { (scm->json json port)))) (define (render-json-string2 json) - (list '((content-type . (application/json))) + (list '((content-type . (text/plain))) (lambda (port) - (display "ThthEST" port)))) + ;; (display "ThthxST" port) + (format port "~a" "foo") + ))) (define (controller request body) (match-lambda @@ -194,6 +200,8 @@ SELECT ?species ?p ?o WHERE { (render-json info)) (('GET "meh") (render-json-string2 "ITEST")) + (('HEAD "meh") + (render-json-string2 "ITEST")) (('GET "meta") (render-json info-meta)) (('GET "version") -- cgit v1.2.3