Fork me on GitHub
#duct
<
2019-07-11
>
jeremy07:07:56

Hi there, apart from @y.khmelevskii has anyone tried to hook up Reitit to Duct?

y.khmelevskii11:07:07

@ULB5985EC just curious, why my example didn’t match you?

jeremy11:07:17

As far as I understand you’re using pedestal and bypassing duct/module.web

jeremy11:07:02

I don’t want pedestal and initially I wanted to use duct/module.web with Reitit as the router

jeremy11:07:30

I’m a bit confused but I think that Reitit wouldn’t work with module.web and I might need to make my own

Greg Rynkowski23:07:11

@ULB5985EC 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 perspective

jeremy07:07:34

awesome! worked perfectly thanks @UBVL1LR5F I'm just starting with Clojure and Duct so that didn't occur to me to do that, but it's makes perfect sense

Greg Rynkowski11:07:53

I’m glad I could help 🙂

romain13:07:57

Hey, I just found another example if you want to study duct with reitit and other cool things: https://github.com/dimovich/roll

jeremy07:07:55

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

jeremy21:07:04

looks like I won't be able to hook it up just like that, I will have to create a module for it