Hi there, apart from @y.khmelevskii has anyone tried to hook up Reitit to Duct?
@clodeindustrie249 just curious, why my example didn’t match you?
As far as I understand you’re using pedestal and bypassing duct/module.web
I don’t want pedestal and initially I wanted to use duct/module.web
with Reitit as the router
I’m a bit confused but I think that Reitit wouldn’t work with module.web
and I might need to make my own
@clodeindustrie249 I use reitit with duct and its jetty server provided by module.web
.
If you are using module.web
I don’t think you need to use module.web
, beside the jetty server. What I do is:
- taking module.web
as a project dependency
- manually declaring :duct.server.http/jetty
(when you use module.web
it is added out-of-the-box)
- creating a :duct/handler
from reitit.ring/ring-handler
- connecting the above handler to aforementioned jetty component
Code snippet from my :duct.profile/base
:
:infrastructure.router/root-handler
{:routes-api #ig/refset :infrastructure.router/api-route
:routes-website #ig/refset :infrastructure.router/website-route}
:duct.server.http/jetty {:port 3000,
:handler #ig/ref :infrastructure.router/root-handler,
:logger #ig/ref :duct/logger}}
I can share some repo if you needed a broader perspectiveawesome! worked perfectly thanks @grzegorzrynkowski_clo I'm just starting with Clojure and Duct so that didn't occur to me to do that, but it's makes perfect sense
I’m glad I could help 🙂
Hey, I just found another example if you want to study duct with reitit and other cool things: https://github.com/dimovich/roll
I have tried a few things, but I am getting a bit confused as to what I am supposed to be able to set :duct/router
to, in my config.edn
looks like I won't be able to hook it up just like that, I will have to create a module for it