The Hunchentoot documentation states:
"The method for ACCEPTOR tries to serve a static file relative to it's ACCEPTOR-DOCUMENT-ROOT."
acceptor-document-root acceptor => (or pathname null)
(setf (acceptor-document-root acceptor ) new-value)
http://weitz.de/hunchentoot/
I am having trouble in translating this documentation into actual Lisp code.
Can someone please give me an example of how to tell Hunchentoot where to look for static web pages to serve?
Here is a snippet which serves a single static webpage:
(push (create-static-file-dispatcher-and-handler
"/stylesheet.css" "~/projects/project-x/stylesheet.css")
*dispatch-table*)
To make a whole folder available try create-folder-dispatcher-and-handler
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With