summaryrefslogtreecommitdiff
path: root/test.scm
diff options
context:
space:
mode:
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))