I want to deploy multiple Luminus apps to wildlfy, is there an easy way to do relative url routing in each app or does each app need to know the contxt-path under which its is deployed ?
@len: the routing mechanism should honor the :context-path that will be in the ring request automatically. Have you tried it and are having issues?
yeah the ring redirects got back to the root path
are you generating the war files with lein immutant war
or with the lein-war
plugin?
I am using lein immutant war
and have the context-path set
I know jcrossley3 has helped with this exact issue before, but he's away today. Would you be willing to provide an example app that demonstrates the issue? I can then take a look here to see what's up
I will try get a small case going = thanks !
my pleasure!
essentially there is a part where we do (resp/redirect "/login")
is that the right way to do it ?
what ns is resp
aliased to?
it is [ring.util.response :as resp]
redirect
doesn't take or use the request map, so doesn't honor :context-path
: https://github.com/ring-clojure/ring/tree/master/ring-core/src/ring/util/response.clj#L26
let me do some more digging to see what the proper way to generate that url is
thanks a million
can you try (resp/redirect (str (:context request-map) "/login"))
?
I thought there was a util in ring that would do that for you, but I'm not seeing it
trying now
afk for a meet will confirm in 15mins
@tcrawley: perfect that works
@len: great! That should also work fine outside of WildFly
yip looks good - just refactoring so all redirects etc use that