This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-16
Channels
- # announcements (11)
- # atom-editor (4)
- # babashka (26)
- # beginners (126)
- # calva (35)
- # chlorine-clover (14)
- # clj-kondo (50)
- # cljfx (1)
- # cljs-dev (1)
- # cljsrn (3)
- # clojure (31)
- # clojure-europe (144)
- # clojure-germany (2)
- # clojure-nl (3)
- # clojure-serbia (17)
- # clojure-spain (11)
- # clojure-uk (38)
- # clojurescript (87)
- # community-development (1)
- # conjure (1)
- # datalog (1)
- # datascript (160)
- # datomic (28)
- # duct (2)
- # emacs (4)
- # events (1)
- # figwheel-main (1)
- # fulcro (15)
- # graalvm (4)
- # honeysql (53)
- # jobs (2)
- # jobs-discuss (14)
- # juxt (6)
- # lsp (59)
- # malli (13)
- # music (1)
- # off-topic (8)
- # pathom (22)
- # portal (7)
- # re-frame (2)
- # reagent (3)
- # releases (1)
- # remote-jobs (1)
- # rewrite-clj (1)
- # shadow-cljs (25)
- # sql (3)
- # tools-deps (38)
- # xtdb (17)
Hello! What is the correct way of setting up a duct + reitit project? Currently, I have the following:
{:duct.profile/base
{:duct.core/project-ns patrulleros.fixtures.directory}
:duct.profile/dev #duct/include "dev"
:duct.profile/local #duct/include "local"
:duct.profile/prod {}
:duct.module/logging {}
:duct.module/web {}
:patrulleros.fixtures.directory.api/router {}}
:patrulleros.fixtures.directory.api/router
inherits from :duct/router
. This key is initiated like this:
(def routes
[["/swagger.json"
{:get {:no-doc true
:swagger {:info {:title "A Title"}}
:handler (reitit.swagger/create-swagger-handler)}}]])
(defn router []
(reitit.ring/router
routes
{:exception reitit.dev.pretty/exception
:data {:coercion reitit.coercion.malli/coercion
:muuntaja (muuntaja/create
(assoc-in (muuntaja/select-formats muuntaja/default-options ["application/json"])
[:formats "application/json" :opts]
{:mapper (-> (jsonista/object-mapper)
(.setSerializationInclusion JsonInclude$Include/NON_EMPTY))}))
:middleware [reitit.swagger/swagger-feature
reitit.ring.middleware.parameters/parameters-middleware
reitit.ring.middleware.muuntaja/format-negotiate-middleware
reitit.ring.middleware.muuntaja/format-response-middleware
;; exception-middleware
reitit.ring.middleware.muuntaja/format-request-middleware
reitit.ring.coercion/coerce-response-middleware
reitit.ring.coercion/coerce-request-middleware]}}))
(defmethod integrant/init-key ::router [_ _]
(reitit.ring/ring-handler
(router)
(reitit.ring/routes
(reitit.swagger-ui/create-swagger-ui-handler {:path "/"})
(reitit.ring/create-default-handler))))
Starting the system results in a NPE inside reitit.ring$_create_file_or_resource_handler
. How should I define my configurations?Here is a very simple duct example with Reitit. Check the config.edn file https://github.com/kwrooijen/duct-simple-example