response-json.rkt 292 B

12345678910111213
  1. #lang racket/base
  2. (require json
  3. racket/list
  4. web-server/http)
  5. (define (response/json output)
  6. (response
  7. 200 #"Okay" (current-seconds) #"application/json; charset=utf-8" empty
  8. (λ (out)
  9. (write-bytes (jsexpr->bytes output) out))))
  10. (provide (all-defined-out))