Fork me on GitHub
#yada
<
2017-07-18
>
stijn12:07:57

how can I create a yada resource that responds with 404 to every possible request?

stijn12:07:32

I'm trying to create a 'catch all' resource at the end of the bidi routes

stijn12:07:23

my best attempt is

stijn12:07:26

(def not-found
  (let [f (fn [ctx]
            (assoc (:response ctx) :status 404))]
    (yada/resource {:methods  {:get {:response f}
                               :post {:response f}
                               :head {:response f}
                               :put {:response f}
                               :delete {:response f}}
                    :logger   #(log/debug (pr-str (:request %)))
                    :produces #{"application/json" "text/plain"}})))

malcolmsparks14:07:13

(yada/yada nil)

malcolmsparks14:07:34

Sorry for the delay, just landing in Berlin!

stijn15:07:50

@malcolmsparks thanks 🙂

stijn15:07:02

see you in Berlin then (leaving tomorrow morning)