About this: >(defroutes app-routes > (ANY "/" request (index request)) >;; <rest of routes> > (GET "/finish-user-sign-up" request (finish-user-sign-up request)) > (route/resources "/") > (route/not-found "Page not found"))
I removed (wrap-resource) and added (route/resources "/") to the routes, in the penultimate position as you suggest, but that seems to have busted things completely. None of the images, css or javascript inside of resources/public can now be found. Any further thoughts on this? This app is suppose to go live today so I would like to figure this out. On Wednesday, February 6, 2013 4:37:09 PM UTC-5, James Reeves wrote: > > Could you try replacing the wrap-resource middleware with the > route/resources function? The latter operates in a slightly different way > to the Ring middleware, and if the Compojure route works without issue, I > might have an idea what the problem is. > > i.e. your code should look like: > > (defroutes app-routes > (ANY "/" request (index request)) > ;; <rest of routes> > (GET "/finish-user-sign-up" request (finish-user-sign-up request)) > (route/resources "/") > (route/not-found "Page not found")) > > You've also got a max-age of 90 for your session cookies, which would mean > your sessions will time out in 90 seconds. Is that what you want? > > Also: > > (GET "/foo" request (foo request)) > > Is equivalent to: > > (GET "/foo" [] foo) > > - James > > > On 6 February 2013 15:10, larry google groups > <lawrenc...@gmail.com<javascript:> > > wrote: > >> >> I created a web app using Ring, Jetty, Enlive, Compojure. >> >> At the end, I bundled everything together by running the command "lein >> uberjar". The resulting file was 21 megs. >> >> I scp the file to the server, then I ssh to the server. I start a >> "screen" session. Inside the screen session I type : >> >> java -jar kiosk-0.1-standalone.jar 30001 >> >> The number at the end is the port that I have it running on. >> >> Sometimes, when people look at the app, none of the CSS files load. I >> have run into this bug myself. Sometimes, when I look at the app, the >> Javascript and CSS paths are broken. If I click "view source" and see the >> source, and if I try to follow the links to the CSS or Javascript, then I >> get 404 errors. >> >> I have this in my code: >> >> (wrap-resource "public") >> >> The structure of the code is: >> >> /resources >> /public >> /css >> /javascript >> /templates >> /src >> /kiosk >> >> The code is still able to find the templates in resources/templates, and >> that HTML is given to Enlive, so something appears on screen. It's just the >> stuff in "public" that sometimes goes missing. >> >> Can anyone suggest why? My routes are defined like this: >> >> >> (defroutes app-routes >> (ANY "/" request (index request)) >> (GET "/search-results" request (search-results request)) >> (GET "/schema" [] (schema)) >> (GET "/account" request (account request)) >> (GET "/login" request (login request)) >> (GET "/start-over" request (start-over request)) >> (GET "/admin" request (admin request)) >> (GET "/ok" request (ok request)) >> (POST "/admin" request (record-new-question-if-any request)) >> (GET "/delete-question/:question-to-delete" request (delete-question >> request)) >> (GET "/finish-user-sign-up" request (finish-user-sign-up request)) >> (route/not-found "Page not found")) >> >> (def app >> (-> app-routes >> (wrap-resource "public") >> (wrap-session {:cookie-name "discovery-session" :cookie-attrs >> {:max-age 90 }}) >> (wrap-cookies) >> (wrap-keyword-params) >> (wrap-nested-params) >> (wrap-params))) >> >> >> -- >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clo...@googlegroups.com<javascript:> >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+u...@googlegroups.com <javascript:> >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en >> --- >> You received this message because you are subscribed to the Google Groups >> "Clojure" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to clojure+u...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.