duct-framework / module.web

Duct module for running web applications
21 stars 19 forks source link

Explain how it works #15

Closed viebel closed 5 years ago

viebel commented 5 years ago

Could you explain how this module works. Could you describe at a high level how it manipulated the config data. In particular, I am interested to understand how the handler data is passed to the :duct.server.http key.

weavejester commented 5 years ago

The module just merges in a bunch of defaults values into the configuration map. It doesn't do much beyond that.

In the case of the :duct.server.http key, it merges in:

{:duct.handler/root {:router  #ig/ref :duct/router}
 :duct.server/http  {:handler #ig/ref :duct.handler/root
                     :logger  #ig/ref :duct/logger}}

Along with a bunch of other stuff. In the cases where keys are already set, it defers to the existing configuration rather than overwriting them.

viebel commented 5 years ago

OK. Thanks