Fork me on GitHub
#duct
<
2021-03-11
>
czwsp04:03:46

Hi, i am beginner in clojure and duct. I am not able to find way to wire to able handle path `/complex`  properly for my hobby project `smallshop`. I’ve set the path in `:duct.router/ataraxy`   and `init-key :smallshop.handler/complex`  in file `complex.clj` under `src/smallshop/handler` . But HTTP request to `127.0.0.1:3000/complex`  always return empty html page. I’ve been look to https://github.com/duct-framework/core/blob/28de7df11af9c95ceb157d0c5163c061a75554b3/README.md and https://circleci.com/blog/build-a-clojure-web-app-using-duct/ but cannot find clue where i am messed up. I’ve create gist for my https://gist.github.com/binilinlquad/4c5ac9db8eb4571340fdcfd27b43ed5f, https://gist.github.com/binilinlquad/c282e0a8c321c33a5423882423c6f05c, and https://gist.github.com/binilinlquad/be501f45c82c333a5668311b94bcf00b. Thank you beforehand.

Kevin08:03:41

You need to change a couple of things. You don't need to create a handler as a module key. I created an example of a duct project for you that has only one endpoint :3000/simple. https://github.com/kwrooijen/duct-simple-example

Kevin08:03:24

This also uses Reitit instead of Ataraxy since it's a bit better developed

czwsp12:03:47

Thanks a lot, I successfully set it up with your sample project as reference.

czwsp12:03:34

And thanks for point out about module. I missed the difference between module and profile.

Kevin13:03:53

Here's a pretty decent overview about the configuration https://github.com/duct-framework/duct/wiki/Configuration

👍 3
Kevin13:03:13

Including the difference betweet base / module / profile keys