This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-24
Channels
- # aleph (4)
- # beginners (93)
- # cider (7)
- # cljs-dev (16)
- # cljsrn (5)
- # clojure (192)
- # clojure-dusseldorf (3)
- # clojure-italy (14)
- # clojure-russia (16)
- # clojure-serbia (1)
- # clojure-spec (85)
- # clojure-taiwan (1)
- # clojure-uk (79)
- # clojurescript (188)
- # code-reviews (9)
- # core-async (2)
- # crypto (1)
- # cursive (26)
- # datomic (21)
- # heroku (1)
- # hoplon (3)
- # jobs (7)
- # jobs-discuss (20)
- # jobs-rus (13)
- # off-topic (77)
- # om (15)
- # onyx (23)
- # pedestal (94)
- # planck (11)
- # proton (10)
- # protorepl (1)
- # re-frame (16)
- # ring (22)
- # ring-swagger (9)
- # rum (2)
- # specter (18)
- # testing (2)
- # untangled (14)
- # vim (12)
- # yada (58)
Hi, is there any way to change the default not-found handler in untangled-server? I do not seem to be able to add my own not-found handler to my custom-routes
is there a way to set the not-found handler? at the moment the bidi-routes seem to hard-wire the not-found handler in untangled.server.impl.components.handler
you could also plug into the hooks of the regular server...there is a fallback-hook described in http://untangled-web.github.io/untangled/guide.html#!/untangled_devguide.M40_Advanced_Server_Topics
it comes just before the not-found, so you could put your logic there and never let if fall through further
Re: untangled css PR. Thanks for the input, I will try to have a look this weekend (only time I can have a look actually). Note: I use it with “plain" Om, so I am not familiar at all with untangled right now.
@jwkoelewijn take a look at https://github.com/untangled-web/untangled-server/tree/develop#23-defining-your-own-middleware, there’s a line that defines a function that returns {:status 404} if it ever gets called
I actually found a solution in Bidi by defining my routes as nested vectors instead of a map I was able to define a not-found handler that was only called whanever no other route matched (compared to adding the [true :not-found] route in the map syntax, that would always match as a result of the not being ordered properties of the map :))
I’ll take a look at your suggestions to see if I can use your suggestions to improve on my current solution, so lot of interesting stuff to look forward to