Fork me on GitHub
#duct
<
2019-06-27
>
grierson08:06:01

How do I add 'wrap-json' middleware to :duct.router/ataraxy?

Kevin09:06:37

You need to add the ^:example meta tag to the route where you want the middleware to run

Kevin09:06:20

Something like this

Kevin09:06:46

(Notice the :middleware :example and the ^:example meta tag)

Kevin09:06:11

And you also need to add :app.middleware/example in your config edn so that it can be initiated

grierson09:06:30

nevermind, wrap-json is breaking my app anyway.

grierson10:06:47

@kevin.van.rooijen Thank you, that worked. Just needed to add the metadata.

Kevin10:06:47

You're welcome :)

Ahmed Hassan12:06:21

As for modules: >Modules are Integrant keywords that derive from :duct/module, and initiate into maps with two keys: :req and :fn. https://github.com/duct-framework/core#modules