Fork me on GitHub
#pedestal
<
2019-05-31
>
hlship18:05:30

When using table syntax for routing, is there an simple/idiomatic way to remove the common prefix:

(route/expand-routes
      #{["/api/job/:job-id" :get
         (get-job client)
         :route-name ::get-job]
        ["/api/jobs" :post
         (create-job client)
         :route-name ::create-job]})
I'd like to wrap these in something that 'supplies' the /api part.

ddeaguiar13:06:58

@U04VDKC4G, you can use a different routing syntax. The terse route syntax supports hierarchical route definitions.

hlship15:06:15

I want my cake and to eat it too. I generally prefer table syntax except for that bit of repetition.

ddeaguiar15:06:05

Yes, I prefer table syntax as well.

ccann20:05:43

ooh, I would love that as well