duct

2020-02-18T09:23:59.055200Z

Is it possible to change the default http port?

2020-02-19T08:53:21.060100Z

@kwrooijen it worked, thanks a lot!

kwrooijen 2020-02-19T08:54:38.060300Z

Good to hear, I made a PR to return a better error message when this happens https://github.com/duct-framework/core/pull/32

👏 1
kwrooijen 2020-02-19T08:55:07.060600Z

Hopefully we can get this merged to help new users

2020-02-19T09:00:49.061Z

that’s great!

teodorlu 2020-02-19T10:14:03.061300Z

@kevin.van.rooijen Thanks for creating the PR! I remember having banged my head against the same problem.

teodorlu 2020-02-18T09:28:14.055300Z

See if you're able to control the arguments passed to :duct.server.http/jetty https://github.com/duct-framework/server.http.jetty

teodorlu 2020-02-18T09:29:06.055600Z

You might be able to control the arguments passed to it from your system data map.

2020-02-18T09:41:29.055800Z

thanks @teodorlu

2020-02-18T09:42:10.056Z

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)

teodorlu 2020-02-18T09:43:32.056400Z

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?

teodorlu 2020-02-18T09:44:08.056600Z

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.

2020-02-18T09:58:19.057100Z

I’ve just tried to parse directly the config.edn file with clojure.edn/read-string and it can read it properly.

2020-02-18T09:59:33.057300Z

I am not sure if it is related that I am not passing the :handler

teodorlu 2020-02-18T10:00:33.057500Z

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.

2020-02-18T10:00:42.057700Z

By default the config for :duct.server.http/jetty has this structure {:port 3000, :handler {:duct.handler/root}, :logger {:key :duct/logger}}

2020-02-18T10:04:20.058Z

thanks @teodorlu I’ll try to play a bit more passing a :handler and a :logger

teodorlu 2020-02-18T10:04:37.058200Z

👍

teodorlu 2020-02-18T10:06:03.058400Z

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/

2020-02-18T10:09:59.058700Z

I also read this blog post. Really good.

kwrooijen 2020-02-18T15:09:37.058900Z

I think you might be defining :duct.server.http/jetty {:port 8888} outside of :duct.profile/base. It should be inside.

kwrooijen 2020-02-18T15:22:55.059200Z

That error happens when you add a regular integrant handler to the "module" space (module space being outside of the base config map)