summaryrefslogtreecommitdiff
path: root/test.scm
diff options
context:
space:
mode:
authorDavid Thompson <davet@gnu.org>2015-11-08 11:09:28 -0500
committerDavid Thompson <davet@gnu.org>2015-11-08 11:09:28 -0500
commitbd540a9de41a238049626f06758b4bc740b71b3d (patch)
treed0180fc121494e6726214d1dbdfbc631c0f09b36 /test.scm
parent445602a86c9a86db035f97ea9efe830acc4d933d (diff)
Add missing code and a README.
Diffstat (limited to 'test.scm')
-rw-r--r--test.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/test.scm b/test.scm
new file mode 100644
index 0000000..92e61cf
--- /dev/null
+++ b/test.scm
@@ -0,0 +1,10 @@
+(use-modules (web socket server))
+
+;; Respond to text messages by reversing the message. Respond to
+;; binary messages with "hello".
+(define (handler data)
+ (if (string? data)
+ (string-reverse data)
+ "hello"))
+
+(run-server handler (make-server-socket #:port 9090))