Fork me on GitHub
#reitit
<
2019-06-27
>
Ahmed Hassan06:06:24

What does :bracket syntax do?

Ahmed Hassan07:06:14

In :bracket syntax :path-params {:id "123", :8080 ":8080"} becomes :path-params {:id "123"}.

Ahmed Hassan07:06:25

Everything else is same.

ikitommi09:06:47

@ahmed1hsn explicit :bracket reads parameters only from brackets {id}, not from colon :id. By default, both are supported. Hope this helps

✔️ 4
Ahmed Hassan09:06:26

@ikitommi exactly, that's the reason why :8080 ":8080" is included, due to colon :8080 in route.

Greg Rynkowski11:06:15

(require '[reitit.middleware :as middleware])

(def wrap2
  (middleware/create
    {:name ::wrap2
     :description "Middleware that does things."
     :wrap wrap}))
https://github.com/metosin/reitit/blob/0.3.9/doc/ring/data_driven_middleware.md#record Hi, is this still a valid way of defining middleware? I can’t find middleware/create anywhere

ikitommi11:06:17

@grzegorzrynkowski_clo good catch, no such helper reitit.middleware/map->Middleware works. Could you update the doc?