I'm trying to implement http router with Clojure https://github.com/clojure/core.match library. But since match is macro - it seems that runtime update of routing table is'n possible without using eval, which is evil. Is there any cleaner way to this?
-
2For HTTP routing, look at Compojure, Noir, or Moustache - probably best not to roll your own, one of those would probably suffice.Alex– Alex2013-02-08 21:08:25 +00:00Commented Feb 8, 2013 at 21:08
-
Eval is not evil if you have tight control over what it gets to evalAnkur– Ankur2013-02-09 07:23:08 +00:00Commented Feb 9, 2013 at 7:23
Add a comment
|
1 Answer
As Alex said in the comments, you're going to want to check out Compojure.
Since you referenced routing in your question here is the Routes in Detail section of the documentation.
There is also this discussion on Stack Overflow about the "big idea" behind compojure routes.