Add #:code to render-json

This commit is contained in:
Christopher Baines 2019-05-19 22:30:50 +01:00
parent 2c35331075
commit cc0ecdc055

View file

@ -100,9 +100,12 @@
(lambda (port) (lambda (port)
(sxml->html sxml port)))) (sxml->html sxml port))))
(define* (render-json json #:key (extra-headers '())) (define* (render-json json #:key (extra-headers '())
(list (append extra-headers (code 200))
'((content-type . (application/json)))) (list (build-response
#:code code
#:headers (append extra-headers
'((content-type . (application/json)))))
(lambda (port) (lambda (port)
(scm->json json port)))) (scm->json json port))))