Apply clack-error-middleware

This commit is contained in:
Akira Tempaku 2025-04-28 22:25:04 +09:00
commit 8d209a1bb4
Signed by: paku
GPG key ID: 5B4E8402BCC50607
5 changed files with 13 additions and 34 deletions

View file

@ -7,10 +7,12 @@
#:configure)
(:import-from #:ningle-fbr
#:set-routes)
(:import-from #:hp/middlewares/recoverer
#:*recoverer*)
(:import-from #:lack-mw
#:*trim-trailing-slash*)
(:import-from #:clack-errors
#:*clack-error-middleware*)
(:import-from #:hp/env
#:hp-env)
(:import-from #:hp/renderer)
(:export #:*app*))
(in-package #:hp/app)
@ -18,7 +20,10 @@
(defparameter *app*
(let ((app (make-app)))
(set-routes app :system :hp :target-dir-path "routes")
(install-middleware app *recoverer*)
(install-middleware app (lambda (app)
(funcall *clack-error-middleware*
app
:debug (string= (hp-env) "dev"))))
(install-middleware app *trim-trailing-slash*)
(static-path app "/img/" "static/img/")
(static-path app "/style/" "static/style/")