Closed daroay closed 11 years ago
Ok, followed this post: http://stackoverflow.com/questions/10986293/how-to-set-a-dynamic-var-in-another-namespace
and did it with: (alter-var-root #'base (constantly "http://"))
This is supposedly exposed to all threads. Is there a better way?
I'm 4 days newbie on clojure
The reason binding won't work is because the base path is used right after the macro expansion takes place in defroutes, if you set the alter before those it should be set.
Iv introduced set-base which uses an atom to do the same, in addition an exception will thrown if no base path was set before using defroutes-
Thanks
I tried with (binding [base "http://..."] ( -> ...start example application... ) )
but no luck