Hello everyone! I'm looking around for a way to expose backend logs (io.pedestal.log -> logback) via REST or HTTP. I stumbled upon http://logback.qos.ch/access.html which seems a good pointer, does anyone have experience on doing this in clj using reitit?
I guess I could just read, parse and return structured data from the logfile itself, I was just looking if there was a better alternative.
Hi,
Is it possible to extract a non parameterized part of the route into a parameter?
For example, /type_a/hi/:name
and /type_b/hi/:name
have different handlers, but Iād like to know in the handler if the request came from type_a
or type_b
without parsing the url
["/v1.0" {:middleware [middleware-a middleware-b middleware-c]}
["/type_a" {:swagger {:tags [:type-a]}}
["/hi/:name" {:post {:handler hi-for-type-a-handler}}]
["/goodbye/:name" {:post {:handler goodbye-for-type-a-handler}}]]
["/type_b" {:swagger {:tags [:type-b]}}
["/hi/:name" {:post {:handler hi-for-type-b-handler}}]
["/goodbye/:name" {:post {:handler goodbye-for-type-b-handler}}]]]
@evg.tso you can pull out the routing Match
from ring request, I recall via (reitit.ring/get-match request)
. It might have the information you need. Currently, there is no way to compile/pre-compute a handler like one can do for middleware, so need to do this at runtime.