Compojure 路由问题
我有一个小型 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:不支持的绑定形式:(或(serve-file (params :*)) :next)
我做错了什么?我从互联网上零散的例子中获取了大部分内容。
添加空向量后,出现此错误:java.lang.Exception:无法解析符号:在此上下文中提供服务文件
I have a small compojure site, with the routes defined as such:
(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"))
When I try to load the project, I get this error:java.lang.Exception: Unsupported binding form: (or (serve-file (params :*)) :next)
What am I doing wrong? I took most of this from scattered examples on the internet.
After adding the empty vector, I get this error:java.lang.Exception: Unable to resolve symbol: serve-file in this context
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您缺少绑定表格:
I think you're missing a binding form: