|
@@ -38,33 +38,31 @@
|
|
|
(respond/ok req '(file "canvas.js"))))
|
|
|
|
|
|
;; new id handler
|
|
|
-(define-http-handler "/api/NewId"
|
|
|
+(define-http-handler (POST) "/api/NewId"
|
|
|
(lambda (req app)
|
|
|
- (respond/ok req (list 'json (api-new-id!)))))
|
|
|
+ (respond/ok req (list 'json (string->number (api-new-id!))))))
|
|
|
|
|
|
;; push buffer handler
|
|
|
-(define-http-handler "/api/PushBuffer"
|
|
|
+(define-http-handler (POST) "/api/PushBuffer"
|
|
|
(lambda (req app)
|
|
|
(let ((body (utf8->string (read-request-body req))))
|
|
|
(respond/ok req (list 'json (api-push-buffer! body))))))
|
|
|
|
|
|
;; push bulk buffer handler
|
|
|
-(define-http-handler "/api/PushBulkBuffer"
|
|
|
+(define-http-handler (POST) "/api/PushBulkBuffer"
|
|
|
(lambda (req app)
|
|
|
(let ((body (utf8->string (read-request-body req))))
|
|
|
(respond/ok req (list 'json (api-push-bulk-buffer! body))))))
|
|
|
|
|
|
;; pull buffer handler
|
|
|
-(define-http-handler "/api/PullBuffer"
|
|
|
+(define-http-handler (POST) "/api/PullBuffer"
|
|
|
(lambda (req app)
|
|
|
(let ((body (utf8->string (read-request-body req))))
|
|
|
(respond/ok req (list 'json (api-pull-buffer! body))))))
|
|
|
|
|
|
;; clear buffer handler
|
|
|
-(define-http-handler "/api/ClearBuffer"
|
|
|
+(define-http-handler (POST) "/api/ClearBuffer"
|
|
|
(lambda (req app)
|
|
|
(api-clear-buffer!)))
|
|
|
|
|
|
(main (command-line))
|
|
|
-
|
|
|
-
|