This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-06
Channels
- # bangalore-clj (16)
- # beginners (120)
- # boot (21)
- # cider (24)
- # clara (9)
- # cljs-experience (1)
- # cljsrn (1)
- # clojure (218)
- # clojure-dev (3)
- # clojure-italy (12)
- # clojure-losangeles (4)
- # clojure-norway (2)
- # clojure-russia (2)
- # clojure-spec (19)
- # clojure-uk (178)
- # clojurescript (52)
- # cursive (7)
- # data-science (55)
- # datomic (25)
- # defnpodcast (11)
- # emacs (5)
- # fulcro (27)
- # hoplon (2)
- # leiningen (14)
- # midje (9)
- # off-topic (132)
- # onyx (19)
- # other-languages (23)
- # portkey (2)
- # re-frame (31)
- # reagent (1)
- # ring-swagger (15)
- # shadow-cljs (58)
- # slack-help (13)
- # spacemacs (22)
- # sql (7)
- # test-check (13)
hey guys, quick question: is the not found
advice at the end still valid? I am using compojure-api
2.0.0-alpha7
and that didnt work for me. I got it to work using an ANY
handler with /*
😕
unfortunately by doing that I get a validation schema
error from swagger
=> attribute paths.'/*'. is unexpected"
@carocad hi. can’t recall what was the not found
advice… but I think this is still valid: https://github.com/weavejester/compojure#usage
@ikitommi thanks for the answer. What I am trying to do is to create a 404
handler for any request that doesnt match any handler.
unfortunately the not-found
function is not called if I use it inside the compojure.api.sweet/api
function. Is this a bug?
I havent tried it with a raw compojure
server though. I had to do it that way because the server throws a NullPointerException
otherwise
here is our handler creation, if it helps https://github.com/hiposfer/kamal/blob/master/src/hiposfer/kamal/server.clj#L24
created a project from template and added (route/not-found "<h1>Page not found</h1>")
into the end. works ok here.
compojure-api warns about non-documented route thou, wrapping that with undocumented
removes the warning.
also, you could do that outside of an api: (let [app (some-fn (create grid) (route/not-found “<h1>Page not found</h1>“))] ...)