Is it possible to change the default http port?
@kwrooijen it worked, thanks a lot!
Good to hear, I made a PR to return a better error message when this happens https://github.com/duct-framework/core/pull/32
Hopefully we can get this merged to help new users
that’s great!
@kevin.van.rooijen Thanks for creating the PR! I remember having banged my head against the same problem.
See if you're able to control the arguments passed to :duct.server.http/jetty
https://github.com/duct-framework/server.http.jetty
You might be able to control the arguments passed to it from your system data map.
thanks @teodorlu
I’ve tried :duct.server.http/jetty {:port 8888}
but I get an error message Execution error (AssertionError) at integrant.core/prep (core.cljc:399). Assert failed: (map? config)
Are you sure your system map is well formed? Are you able to able to work with it as a data structure within your normal Clojure code?
I suspect you might see something like that if you're missing some parens or have gotten an odd number of entries in your map.
https://github.com/duct-framework/docs/blob/master/GUIDE.rst#configuration
I’ve just tried to parse directly the config.edn
file with clojure.edn/read-string
and it can read it properly.
I am not sure if it is related that I am not passing the :handler
I guess you'd need a handler for any of this to make sense. I still find the Assert failed: (map? config)
a bit surprising.
By default the config for :duct.server.http/jetty
has this structure {:port 3000, :handler {:duct.handler/root}, :logger {:key :duct/logger}}
thanks @teodorlu I’ll try to play a bit more passing a :handler
and a :logger
👍
I'm by no means a Duct expert myself, but I remember that I had to fiddle a lot with the meaning of all the data stuff before I started to understand how it all fit together. A few more things clicked for me when I worked through this tutorial: https://circleci.com/blog/build-a-clojure-web-app-using-duct/
I also read this blog post. Really good.
I think you might be defining :duct.server.http/jetty {:port 8888}
outside of :duct.profile/base
. It should be inside.
That error happens when you add a regular integrant handler to the "module" space (module space being outside of the base config map)