aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPjotr Prins2023-07-08 03:43:48 -0500
committerPjotr Prins2023-07-08 03:43:48 -0500
commitb70fdef2f3edce38324fff04052a3ec8054ffa1f (patch)
treecb10c6a1bc311b015113e3e4798c9724a746e6fb
parenta358be572fb9b132dcb9dce8dfbae361c6217b3b (diff)
downloadgenenetwork3-b70fdef2f3edce38324fff04052a3ec8054ffa1f.tar.gz
guile server: indent
-rwxr-xr-xgn3-guile/web/webserver.scm59
1 files changed, 29 insertions, 30 deletions
diff --git a/gn3-guile/web/webserver.scm b/gn3-guile/web/webserver.scm
index 9195044..f940a08 100755
--- a/gn3-guile/web/webserver.scm
+++ b/gn3-guile/web/webserver.scm
@@ -3,48 +3,47 @@
!#
;; Minimal web server can be started from command line. Current example routes:
;;
-;; localhost:8080/version.json
+;; localhost:8080/
;;
-;; Note that this is a single blocking thread server right now.
-(use-modules (json)
- (ice-9 match)
- (ice-9 format)
- (srfi srfi-1)
- (srfi srfi-26)
- (web http)
- (web request)
- (web response)
- (web uri)
- (fibers web server)
- )
+(use-modules
+ (json)
+ (ice-9 match)
+ (ice-9 format)
+ (srfi srfi-1)
+ (srfi srfi-26)
+ (web http)
+ (web request)
+ (web response)
+ (web uri)
+ (fibers web server))
(define (get-version)
"2.0")
(define info-list `(
- ("name" . "GeneNetwork REST API")
- ("version" . ,(get-version))
- ("comment" . "This is the official REST API for the GeneNetwork service hosted at https://genenetwork.org/")
- ("license" . (("source code" . "AGPL")))
- ("note" . "work in progress (WIP)")
- ("api". #(
- "https://genenetwork.org/api/v2/species/"
- "https://genenetwork.org/api/v2/populations/"
- "https://genenetwork.org/api/v2/datasets/"
- )
- )))
+ ("name" . "GeneNetwork REST API")
+ ("version" . ,(get-version))
+ ("comment" . "This is the official REST API for the GeneNetwork service hosted at https://genenetwork.org/")
+ ("license" . (("source code" . "AGPL")))
+ ("note" . "work in progress (WIP)")
+ ("api". #(
+ "https://genenetwork.org/api/v2/species/"
+ "https://genenetwork.org/api/v2/populations/"
+ "https://genenetwork.org/api/v2/datasets/"
+ )
+ )))
(define (get-species)
'(("Mus_musculus" . (("id" . "mouse" )
- ("api" . "https://genenetwork.org/api/v2/mouse/")))
- ("Rattus_norvegicus" . (("id" . "rat")
- ("api" . "https://genenetwork.org/api/v2/rat/")))
- ))
+ ("api" . "https://genenetwork.org/api/v2/mouse/")))
+ ("Rattus_norvegicus" . (("id" . "rat")
+ ("api" . "https://genenetwork.org/api/v2/rat/")))
+ ))
(define (get-species-api-str)
(scm->json-string #("https://genenetwork.org/api/v2/mouse/"
- "https://genenetwork.org/api/v2/rat/")))
+ "https://genenetwork.org/api/v2/rat/")))
;; ---- REST API web server handler
@@ -100,5 +99,5 @@
(let ((listen (inexact->exact (string->number (car (cdr args))))))
(display `("listening on" ,listen))
;; (write listen)
- ; (run-server hello-world-handler 'http `(#:port ,listen))))
+ ;; (run-server hello-world-handler 'http `(#:port ,listen))))
(start-web-server "127.0.0.1" listen)))