duct

Michel A. 2020-07-06T14:09:55.212400Z

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]}}}}}

kwrooijen 2020-07-06T14:48:25.212900Z

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

kwrooijen 2020-07-06T14:49:09.213300Z

It disregards any nesting

kwrooijen 2020-07-06T14:49:46.213800Z

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

☝️ 1
kwrooijen 2020-07-06T14:50:06.214200Z

However I switched to reitit all together

🎉 1
Michel A. 2020-07-06T16:16:44.215100Z

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