Fork me on GitHub
#reitit
<
2024-04-02
>
grzm15:04:34

Hello! Is there a standard way of getting the name of a route from the request? What I'm doing right now is (get-in req [:reitit.core/match :data :name]). Is that stable? Is there a more idiomatic way to get the route name from the request?

wevrem16:04:50

That’s the same pattern I’ve followed. Not to get the :name but instead some other custom data I stuffed into the :data of the routes.

(-> request :reitit.core/match :data ::level)

grzm16:04:39

Cheers. At least I know I'm not alone 🙂

wevrem12:04:04

What do you determine after reading the docs?

grzm13:04:31

I didn’t find anything when I was looking at the docs that definitely indicated either way. I could have missed it, though.