我有一个小的compojure站点,其路由定义如下:
(defroutes example
(GET "/" [] {:status 200
:headers {"Content-Type" "text/html"}
:body (home)})
(GET "/*" (or (serve-file (params :*)) :next))
(GET "/execute/" [] {:status 200
:headers {"Content-Type" "text/html"}
:body (execute-changes)})
(GET "/status/" [] {:status 200
:headers {"Content-Type" "text/html"}
:body (status)})
(route/not-found "Page not found"))当我试图加载项目时,我得到了这个错误:
java.lang.Exception: Unsupported binding form: (or (serve-file (params :*)) :next)
我做错了什么?我从互联网上零散的例子中获取了大部分内容。
在添加了空向量之后,我得到了这个错误:
java.lang.Exception: Unable to resolve symbol: serve-file in this context
发布于 2010-10-09 02:56:05
我想你遗漏了一个绑定形式:
(GET "/*" {params :params} (or (serve-file (params :*)) :next))
; ^- note the binding formhttps://stackoverflow.com/questions/3893344
复制相似问题