Add #:code to render-json

This commit is contained in:
Christopher Baines 2019-05-19 22:30:50 +01:00
parent 2c35331075
commit cc0ecdc055
1 changed files with 6 additions and 3 deletions

View File

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