middleware.scm 575 B

12345678910111213141516171819202122
  1. (library (middleware)
  2. (export logging-middleware)
  3. (import
  4. ;; language base
  5. (rnrs base)
  6. ;; lambda forms from guile
  7. (only (guile) lambda* λ)
  8. ;; for request-path-components
  9. (web request)
  10. ;; for log:debug
  11. (prefix (logging) log:)
  12. (request-utils)))
  13. (define logging-middleware
  14. (λ (request body)
  15. "The logging middleware takes care of logging to stdout
  16. whenever a request comes in. We can imagine all sorts of
  17. logging here."
  18. (log:debug "responding for request-path-components:"
  19. (request-path-components request))))