summaryrefslogtreecommitdiff
path: root/test.scm
blob: 92e61cf615fa1c53be16e5e6b90ede857a76581b (plain)
1
2
3
4
5
6
7
8
9
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))