awful-sse/tests/client.scm

21 lines
486 B
Scheme
Raw Normal View History

2020-12-29 02:29:22 +00:00
(import (awful sse))
2014-07-08 18:45:06 +00:00
(define (sse-proc)
(send-sse-data "sse"))
(define-page/sse "/client"
(lambda ()
;; Unnecessary as our client it not a browser
;; (add-javascript
;; "var source = new EventSource('/sse');
;; source.onmessage = function (event) {
;; display = document.getElementById('display');
;; display.innerHTML = event.data;
;; };")
"foo") ; page contents won't be accessed anyway
"/sse"
sse-proc
no-template: #t)