(defn route2 [root]
(let [coll-route (keyword root)
coll-handler (fn [req] {:ok :ok})]
`~[(str "/" root) {:get [coll-route coll-handler]}]))
(def routes2
(expand-routes
`[[["/api" {:get api-get}
~(route2 "questions")
]]]))
streaker-service.routes> (-> (route2 "questions")
(clojure.pprint/pprint))
["/questions"
{:get
[:questions
#<routes$route2$coll_handler__28266 streaker_service.routes$route2$coll_handler__28266@11c2ceab>]}]
nil
streaker-service.routes> (clojure.pprint/pprint routes2)
({:route-name :streaker-service.routes/api-get,
:path-re #"/\Qapi\E",
:method :get,
:path "/api",
:path-parts ["api"],
:path-params [],
:interceptors
[{:name :streaker-service.routes/api-get,
:enter
#<interceptor$before$fn__10535 io.pedestal.interceptor$before$fn__10535@42fbb35f>,
:leave nil,
:error nil}]}
{:route-name :questions,
:path-re #"/\Qapi\E/\Qquestions\E",
:method :get,
:path "/api/questions",
:path-parts ["api" "questions"],
:path-params [],
:interceptors [nil]})
nil