This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-12
Channels
- # announcements (1)
- # babashka (32)
- # beginners (27)
- # calva (4)
- # clojure (18)
- # clojure-australia (2)
- # clojure-europe (11)
- # clojure-spec (8)
- # clojure-uk (15)
- # clojurescript (8)
- # cursive (14)
- # datomic (12)
- # fulcro (36)
- # graalvm (3)
- # graphql (2)
- # jobs (1)
- # meander (1)
- # pathom (5)
- # pedestal (12)
- # re-frame (1)
- # reagent (1)
- # reitit (2)
- # testing (12)
- # vim (2)
Is it possible to define a default route in pedestal? e.g. if I don't get any hits, call this interceptor/handler.
Ive done something similar with Reitit + Ring in the past. There you could define a "default handler".
One way to do it is to add a default interceptor that takes care of it.
You can do so be specifying a catch-all route and using the linear-search router. The caveat is that the catchall route needs to be the last one specified.
You either use the terse route syntax or the table-routes fn to expand your routes directly
Funny enough I was just looking at adding this info to the docs. It came up some time ago in the pedestal user groups (https://groups.google.com/g/pedestal-users/c/lkrODbKivaU/m/cOtDLJNBDQAJ)
One could well imagine wanting to use a different route resolution algorithm while also having a default handler specified, right? It’s a bit sad that it’s complected like that.
For browsers, consider 303
+ Location
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location