debug.scm 739 B

1234567891011121314151617181920212223242526
  1. (library (handlers debug)
  2. (export debug-handler)
  3. (import
  4. (except (rnrs base) let-values error)
  5. (only (guile) lambda* λ)
  6. ;; standard web library
  7. (web response)
  8. ;; logging
  9. (prefix (lib logging) log:)
  10. ;; templates
  11. (templates debug)
  12. (templates helpers)
  13. ;; web helpers
  14. (lib utils response-utils)))
  15. (define debug-handler
  16. (lambda (request body)
  17. "The debug-handler will put all request headers into the
  18. rendered HTML, so that we can see them on the page."
  19. (log:debug "responding using debug handler")
  20. (create-html-response
  21. ;; Inside respond the SXML will be put into a template,
  22. ;; so there is no need to add html or body tags.
  23. (debug-table-template request body))))