Fork me on GitHub
#duct
<
2020-07-06
>
Michel A.14:07:55

hello all, is there a recommended way of ordering middleware in ataraxy ? I know that this is feasable at the level of the :duct/handler.root but I cannot manage to order correctly ataraxy root middleware. Ex : here I want the :auth middleware to apply before the ^:all-roles or the ^:admin one thanks

{:routes
   {
    "/auth" ^:auth
    {"/files"
     {[:post #{files}] ^:all-roles
      [:my.project/create files]

      ["/" file-id] ^:admin
      {:delete [:my.project/delete ^uuid file-id]}}}}}

Kevin14:07:25

The problem with ataraxy is dat it orders by reverse alphabetical naming

Kevin14:07:09

It disregards any nesting

Kevin14:07:46

The best way I could think of a solution is by doing something like :aaa/middleware2 :bbb/middleware1

☝️ 3
Kevin14:07:06

However I switched to reitit all together

🎉 3
Michel A.16:07:44

@kevin.van.rooijen thank you for your feedback.