Created
February 12, 2011 16:07
-
-
Save lynaghk/823847 to your computer and use it in GitHub Desktop.
compojure resources problem between 0.5.2 and 0.6.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;/login.html (a static resource) does not work in [compojure "0.6.0-RC4"] | |
;;however, the simple GET works fine | |
;; 2011-02-12 08:03:25.840:WARN::/login.html | |
;; java.lang.NullPointerException | |
;; at ring.middleware.session$wrap_session$fn__3069.invoke(session.clj:47) | |
;; at ring.middleware.cookies$wrap_cookies$fn__3009.invoke(cookies.clj:132) | |
;; at clojure.lang.Var.invoke(Var.java:365) | |
;; at ring.adapter.jetty$proxy_handler$fn__2063.invoke(jetty.clj:16) | |
;; | |
(ns grr | |
(:use compojure.core | |
[ring.adapter.jetty :only [run-jetty]]) | |
(:require | |
(compojure [route :as route] | |
[handler :as handler]))) | |
(defroutes my-routes | |
(GET "/grr" [] "grr") | |
(route/resources "/" {:root "/dev_public"})) | |
(def app (-> my-routes | |
handler/site | |
)) | |
(defonce *server* | |
(run-jetty #'app {:port 4567 :join? false})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For the record: James Reeves found the error; there shouldn't be a prefix slash on (route/resources {:root "/dev_public"}).
This slash was automatically removed by compojure 0.5.2, but not 0.6.0.