website/src/app.lisp

33 lines
1,014 B
Common Lisp
Raw Normal View History

2024-10-05 22:05:26 +09:00
(defpackage #:hp/app
2024-02-02 01:07:19 +09:00
(:use #:cl)
2025-03-29 01:07:45 +09:00
(:import-from #:jingle
#:make-app
#:install-middleware
2025-03-29 03:46:58 +09:00
#:static-path
2025-03-29 01:07:45 +09:00
#:configure)
(:import-from #:ningle-fbr
#:set-routes)
2025-03-29 03:46:58 +09:00
(:import-from #:lack-mw
2024-12-20 15:25:14 +09:00
#:*trim-trailing-slash*)
2025-04-28 22:25:04 +09:00
(:import-from #:clack-errors
#:*clack-error-middleware*)
2025-04-29 01:39:41 +09:00
(:import-from #:hp/lib/env
2025-04-28 22:25:04 +09:00
#:hp-env)
2024-10-03 14:48:42 +09:00
(:import-from #:hp/renderer)
2024-10-05 22:05:26 +09:00
(:export #:*app*))
(in-package #:hp/app)
2025-03-29 01:07:45 +09:00
(defparameter *app*
(let ((app (make-app)))
(set-routes app :system :hp :target-dir-path "routes")
2025-04-28 22:25:04 +09:00
(install-middleware app (lambda (app)
(funcall *clack-error-middleware*
app
:debug (string= (hp-env) "dev"))))
2025-03-29 01:07:45 +09:00
(install-middleware app *trim-trailing-slash*)
2025-03-30 17:13:52 +09:00
(static-path app "/img/" "static/img/")
(static-path app "/style/" "static/style/")
2025-03-29 01:07:45 +09:00
(configure app)))
2024-02-14 00:15:37 +09:00
2025-03-29 01:07:45 +09:00
*app*