about summary refs log tree commit diff stats
path: root/rnd
diff options
context:
space:
mode:
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.scm24
-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
16 17 18 19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85