Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Clojure 复合路由问题_Clojure_Routes_Compojure - Fatal编程技术网

Clojure 复合路由问题

Clojure 复合路由问题,clojure,routes,compojure,Clojure,Routes,Compojure,我有一个小型compojure站点,其路线定义如下: (defroutes example (GET "/" [] {:status 200 :headers {"Content-Type" "text/html"} :body (home)}) (GET "/*" (or (serve-file (params :*)) :next)) (GET "/execute/" [] {:status 200

我有一个小型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:不支持的绑定形式:(或(服务文件(参数:):下一步)

我做错了什么?我从互联网上零散的例子中获取了大部分信息

添加空向量后,我得到以下错误:

java.lang.Exception:无法解析此上下文中的symbol:serve文件

我认为您缺少绑定表单:

(GET "/*" {params :params} (or (serve-file (params :*)) :next))
        ; ^- note the binding form

在最近的Compojure中,我认为它应该是
{params:params}
,而不是空向量,因为Compojure不再为您设置magic
params
本地。