Fork me on GitHub
#duct
<
2018-02-13
>
iarenaza15:02:46

@weavejester I haven't figured it out yet (I'm a bit new to Clojure, and especially Duct). So could you give me any hints on how to use :duct.module.web/site for some routes and :duct.module.web/api for the others?

weavejester15:02:58

@iarenaza Use :duct.module.web/site and then add the format middleware manually, like so:

:duct.core/handler {:middleware [#ig/ref :duct.middleware.web/format]}
:duct.middleware.web/format {}

mariusz_jachimowicz15:02:41

@weavejester I have started some alternative implementation for duct sql module and I don't understand why :duct.database/sql is not initialized in system please see db-pool-test in https://github.com/mariusz-jachimowicz-83/duct-env-dbs/blob/master/test/duct_env_dbs/module_test.clj

weavejester15:02:58

@mariusz_jachimowicz What’s your module name?

weavejester15:02:13

It looks like you’re calling your module :duct.module/sql, but that’s going to conflict with the :duct.module/sql in Duct itself. You want to ensure that the name of the module is consistent with the namespace where the method is defined.

weavejester15:02:39

You want something more like: :duct-env-dbs.module/sql.

mariusz_jachimowicz15:02:32

yes my intention was to have replacement for the default one.

weavejester15:02:27

You still want to give it its own namespace; that’s what namespaces are for.

mariusz_jachimowicz16:02:54

Even though I thought that :duct.database/sql will be initialized as an result of launching :duct.database.sql/hikaricp because of expanding ancestor key or something like that

weavejester18:02:34

@mariusz_jachimowicz It should do, as long as the hierarchy is loaded.

mariusz_jachimowicz22:02:42

@weavejester thx. I will try with proper module name.