This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-12
Channels
- # announcements (10)
- # babashka (26)
- # beginners (113)
- # calva (75)
- # cider (7)
- # clj-http (1)
- # cljdoc (2)
- # cljfx (3)
- # cljs-dev (13)
- # clojure (79)
- # clojure-europe (21)
- # clojure-losangeles (2)
- # clojure-nl (4)
- # clojure-sweden (1)
- # clojure-uk (23)
- # clojureladies (4)
- # clojurescript (26)
- # clojureverse-ops (2)
- # conjure (2)
- # cursive (2)
- # data-science (1)
- # datalog (6)
- # datomic (1)
- # degree9 (2)
- # depstar (4)
- # esprit (3)
- # fulcro (25)
- # introduce-yourself (2)
- # jobs (3)
- # lsp (30)
- # meander (38)
- # missionary (9)
- # nbb (7)
- # news-and-articles (2)
- # off-topic (28)
- # pathom (46)
- # polylith (19)
- # re-frame (4)
- # reitit (2)
- # sci (8)
- # shadow-cljs (23)
- # specter (17)
- # spire (1)
- # tools-deps (16)
- # unrepl (1)
- # xtdb (30)
Hey, is it possible to have middleware apply to default routes using ring? The use case is wanting 404s to return JSON responses, and using the same middleware chain as the router to do this.
If I try to return a vector/map from reitit.ring/create-default-handler
I receive a HTML response from jetty:
Error 500 java.lang.IllegalArgumentException: No implementation of method: :write-body-to-stream of protocol:
#'ring.core.protocols/StreamableResponseBody found for class: clojure.lang.PersistentArrayMap
For reference I’ve followed this example:
https://github.com/metosin/reitit/blob/master/examples/ring-malli-swagger/src/example/server.clj
so my middleware is defined in -> :data :middleware
under ring/router