Using Context Root in war

50 views
Skip to first unread message

Stephen Mann

unread,
Oct 13, 2011, 11:18:58 PM10/13/11
to clj-noir
Ideally I'd like to be able to serve the project

- locally as: http://localhost/some-route
- in tomcat as: http://tomcat/my-app-name/some-route

After a good deal of hunting I found that adding this line seems to do
the trick -- meaning that javascript, css, and form paths include the
appropriate context root.

(noir.server.handler/add-custom-middleware hiccup.middleware/wrap-
base-url)

My questions are these.

1. Is this the correct way to solve this problem?

2. noir.reponse/redirects still don't seem to use the context root
properly. Anyone else seeing this?

3. Documentation on this was pretty thin. Thoughts on where some
might go? Alternately, it seems like this change is another step
towards making Noir "just work" when deploying a war to tomcat.
Should this wrap-base-url be included middleware out of the box?


I've started using Noir for some small projects at work. So far it's
been a pleasure. Thanks to everyone who's making Noir possible!

Chris Granger

unread,
Oct 13, 2011, 11:21:37 PM10/13/11
to clj-...@googlegroups.com
This was actually brought up the other day:


It'll be in there by default soon :)

Cheers,
Chris.

Stephen Mann

unread,
Oct 13, 2011, 11:25:27 PM10/13/11
to clj-noir
Great, I'll look forward to it.

Thanks for the quick response!
Reply all
Reply to author
Forward
0 new messages