Fork me on GitHub

Hi I had an issue where I use router to route to my views, but in one view I need to find a route by name so it has a dependency on router again. This creates a circular dep. I assume this is a common issue. How to get around this issue?


There are many ways how it can be handled. One is to pass the router to the view. Or if you’re using re-frame you could store the router into the app-db and subscribe to it in your view.


We use Reitit Ring for our web application servers. On one of servers, though, we need to allow certain routes based on IP range of the visitor, and on another route, allow only a specific IP through. I suppose we could do this via custom middleware, but Apache has done this so long with its Deny and Allow commands that there must be a way it is easily done with Reitit in general. How can I do the equivalent of Apache's Deny/Allow statements in Reitit (Ring-style)?


To simplify, forget about apache. I just need to be able to block and serve particular IP addresses