4

ルートが次のように定義された小さな構成サイトがあります。

(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

4

1 に答える 1

6

拘束力のあるフォームが不足していると思います:

(GET "/*" {params :params} (or (serve-file (params :*)) :next))
        ; ^- note the binding form
于 2010-10-08T18:56:04.810 に答える