diff options
author | elioat <elioat@tilde.institute> | 2022-12-04 15:16:52 -0500 |
---|---|---|
committer | elioat <elioat@tilde.institute> | 2022-12-04 15:16:52 -0500 |
commit | 5831542e01209729390f5171d54f505b133ab47e (patch) | |
tree | 188391d6e89393849d5b6f53cfb5ca6d994536f5 /rnd | |
parent | 8f83e6377a7a5e4209f8996c1c9e6870f8ec66b5 (diff) | |
download | december-2022-5831542e01209729390f5171d54f505b133ab47e.tar.gz |
re-org of rnd
Diffstat (limited to 'rnd')
-rw-r--r-- | rnd/apl/aoc01_partial.apl (renamed from rnd/aoc01_partial.apl) | 0 | ||||
-rw-r--r-- | rnd/gerbil/play.ss (renamed from rnd/play.ss) | 0 | ||||
-rw-r--r-- | rnd/guile/play.scm | 24 | ||||
-rw-r--r-- | rnd/racket/sketch.rkt (renamed from rnd/sketch.rkt) | 0 |
4 files changed, 24 insertions, 0 deletions
diff --git a/rnd/aoc01_partial.apl b/rnd/apl/aoc01_partial.apl index 67d9984..67d9984 100644 --- a/rnd/aoc01_partial.apl +++ b/rnd/apl/aoc01_partial.apl diff --git a/rnd/play.ss b/rnd/gerbil/play.ss index 7a7c3ca..7a7c3ca 100644 --- a/rnd/play.ss +++ b/rnd/gerbil/play.ss diff --git a/rnd/guile/play.scm b/rnd/guile/play.scm new file mode 100644 index 0000000..92d5538 --- /dev/null +++ b/rnd/guile/play.scm @@ -0,0 +1,24 @@ +;;; Hello HTTP server +(use-modules + (web server) + (web request) + (web response) + (web uri)) + +(define (request-path-components request) + (split-and-decode-uri-path (uri-path (request-uri request)))) + +(define (hello-handler request body) + (if (equal? (request-path-components request) + '("banana")) + (values '((content-type . (text/plain))) + "banana kiwi apple pineapple watermelon grapefruit") + (not-found request))) + +(define (not-found request) + (values (build-response #:code 404) + (string-append "Resource not found: " + (uri->string (request-uri request))))) + + +(run-server hello-handler) diff --git a/rnd/sketch.rkt b/rnd/racket/sketch.rkt index dd25774..dd25774 100644 --- a/rnd/sketch.rkt +++ b/rnd/racket/sketch.rkt |