Is it possible to define a default route in pedestal? e.g. if I don't get any hits, call this interceptor/handler.
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.
I use ::http/not-found-interceptor
Aha!
For browsers, consider 303
+ Location
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location
Right, doing an explicit redirect makes a lot of sense.
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)
Thanks @ddeaguiar your answer was exactly what I was looking for π