Fork me on GitHub

@colliderwriter I idea more. I think there could be just a generic wrapper that could be used to wrap the Sieppari-style error interceptors. e.g.

;; with Sieppari
:interceptors [(exceptions/exception-interceptor)]

;; with Pedestal
:interceptors [(reitit.pedestal/interceptor (exceptions/exception-interceptor))]
would that be possible? would be a generic solution for future too.


and actually, the wrapping could automatic here: e.g. if the interceptor has :error of 1-arity…


interceptors get compiled once, on router creation, so there is no runtime perf penalty, besides some interceptors having a extra wrapper.


hi all, is there a way to escape colons in a path? for dev, i’m running some server in a specific port, so i have something like "", but i’m running into some errors, and I realized the colon might be interpreted as a parameter.


Scratch that, it seems the problem is simply having a route parameter when the root isn’t /. Is there any particular reason why Routes must start from the root, so they must begin with a '/'?


@levitanong that is a bad constraint from the past, should be removed


Oh, but in Ring, all the uris should start with /?


> :uri (Required, String) > The request URI, excluding the query string and the "?" separator. > Must start with "/".


@ikitommi i’m writing a server in nodejs though, so it’s not ring 😛 And besides, I see value in allowing non-“/”, in cases where you want your server to connect to an external resource as a client.


Not sure where the check currently is, or if there even is a check and reitit just doesn't work, but if there is a check, it should be moved to reitit-ring module. And I don't see how "cases where you want to server to connect to an external resource" relates to Reitit?


@juhoteperi i find it handy to use the reitit data structure to move routes to config. Consider the case where my group is developing both a set of microservices and a project that consumes these microservices. The project will have its own develop/staging/master deployments and likewise for the other microservices. Needless to say, we don’t want something in develop interacting with something in master. reitit helps me solve this problem by associating a URL with a route name. In my networking code, I can just worry about dealing with that route name, and assume the it will go to the right URL.


Is there a way to specify spec-coerced query parameters so they are optional? or to allow lists in body parameters? I get coercion errors

(s/def ::maybe-int? (s/or :int integer? :nil nil?))
(s/conform ::maybe-int? nil)
(s/def ::vec-two-strings (s/cat :one string? :two string?) )
(s/conform  ::vec-two-strings '["tom" "sam"])