not manx 4 years ago
parent 77acae992e
commit c8ad02cd2f
Signed by: C-xC-c
GPG Key ID: F52ED472284EF2F4

@ -1,8 +1,8 @@
(asdf:defsystem #:hunchenhelpers
:description "A helper library for hunchentoot"
:author "Manx (boku@plum.moe)"
:license "X11/MIT"
:version "1.0.0"
:author "Manx <boku@plum.moe>"
:license "GPLv3"
:version "1.1.0"
:serial t
:depends-on (:hunchentoot)
:Components ((:file "package")

@ -18,6 +18,13 @@
(defun host-dir (uri path &optional content-type)
(hunchenhost tbnl:create-folder-dispatcher-and-handler uri path content-type))
(defmacro config-item (thing &aux (item (gensym)))
"Get `thing' from the alist `config', error if it doesn't exist"
`(let ((,item (assoc ,thing (eval (read-from-string "config")))))
(when (atom ,item)
(error "No such config item"))
(cdr ,item)))
;; Stolen from stackoverflow
(defmacro method-path (methods path)
"Expands to a predicate the returns true of the Hunchtoot request
@ -60,4 +67,5 @@ handler.
(export '(host-file
host-dir
handle
acceptor))
acceptor
config-item))

@ -1,3 +1,3 @@
(defpackage #:hunchenhelpers
(:nicknames :henh)
(:nicknames #:toot)
(:use #:cl))

Loading…
Cancel
Save