Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell Hunchentoot where to find static web pages to serve?

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?

like image 996
mobydick Avatar asked Nov 27 '11 11:11

mobydick


1 Answers

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.

like image 91
chrm Avatar answered Oct 01 '22 10:10

chrm