Hunchentoot文件指出:
“接受者的方法尝试服务静态文件相对于它的受体-文档-根。
接收方-文档-根接收方=> (或路径名为null)
(setf (接受者-文件-根接受者)新价值)
http://weitz.de/hunchentoot/
我很难将这些文档转换成实际的Lisp代码。
有人能给我举个例子,说明如何告诉Hunchentoot在哪里寻找静态网页吗?
发布于 2011-11-27 20:17:29
对代码的最简单的翻译是:
(hunchentoot:start (make-instance 'hunchentoot:acceptor :port 4242
:document-root #p"<path to static files dir>"))发布于 2011-11-27 12:57:26
下面是一个为单个静态网页提供服务的片段:
(push (create-static-file-dispatcher-and-handler
"/stylesheet.css" "~/projects/project-x/stylesheet.css")
*dispatch-table*)要使整个文件夹可用,请尝试使用create-folder-dispatcher-and-handler。
https://stackoverflow.com/questions/8285115
复制相似问题