从Hunchentoot服务器中删除默认项目

094*_*653 1 common-lisp hunchentoot

Hunchentoot附带了一些默认文件,它没有添加任何新的处理程序.它们存储在/path/to/hunchentoot/www/.我无法弄清楚如何阻止他们被送达.我已经尝试过了*dispatch-table*,*easy-handler-alist*但没有任何东西,我无论如何都找不到删除它们的方法.有没有办法在请求其中一个页面时至少使它成为404而不从该目录中删除所有文件(在更新时会恢复)?

jla*_*ahd 5

这些文件可以通过acceptor document-root槽的值找到.您可以在创建接受器时覆盖它:

(make-instance 'hunchentoot:easy-acceptor :port 8080 :document-root "/my/docs/")
Run Code Online (Sandbox Code Playgroud)

只需将其指向一个空目录即可默认提供任何内容.

如有必要,www/errors/可以通过error-template-directory以类似方式设置插槽,从其他位置读取位于其中的错误页面模板.