This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-22
Channels
- # announcements (18)
- # babashka (9)
- # beginners (22)
- # biff (2)
- # calva (17)
- # clj-kondo (5)
- # clojure (9)
- # clojure-europe (25)
- # clojure-nl (1)
- # clojure-norway (3)
- # clojure-uk (7)
- # clojuredesign-podcast (6)
- # clojurescript (61)
- # cursive (11)
- # data-science (1)
- # datahike (3)
- # datomic (2)
- # humbleui (2)
- # hyperfiddle (7)
- # jobs (1)
- # jobs-discuss (4)
- # joyride (1)
- # overtone (7)
- # re-frame (2)
- # reitit (9)
- # releases (2)
- # remote-jobs (8)
- # scittle (1)
- # shadow-cljs (48)
- # squint (8)
Posting here from the (rather unpopulated) #compojure channel: In compojure, am I able to create a "catch-all" default route if no other routes are matched? I'm basically trying to return a response that includes parts of the original request (for debugging). There is the compojure.route/not-found function(macro?), but I don't see how I'd be able to get the request with it- as far as I can tell I can only provide an explicit (as in, non-parameterized) body to use as response.
The way compojure does routing it applies a handler to a request, and if the handler returns nil that means the route did not match
Alternatively, I believe you can just put a ring handler at the end of all your routes
Because what (GET ...) actually does is create a ring handler, so what routes (and defroutes) take is a sequence of handlers to try in turn
I think I understand what you're talking about, I am defining everything via defroutes, I'll try and wrap that in something that'll give me my debug info- appreciate the input so far!