Skip to content

Instantly share code, notes, and snippets.

@souenzzo
Created June 30, 2022 03:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save souenzzo/5c1ad0b3613c029b4d70900862e769e6 to your computer and use it in GitHub Desktop.
Save souenzzo/5c1ad0b3613c029b4d70900862e769e6 to your computer and use it in GitHub Desktop.
(require '[io.pedestal.http :as http]
'[io.pedestal.test :refer [response-for]])
(let [*req (promise)
service-fn (-> {::http/routes `#{["/contrast-agent/:arg" :get ~(fn [req]
(deliver *req req)
{:status 202})
:route-name :debug]}}
http/default-interceptors
http/create-servlet
::http/service-fn)]
(response-for service-fn
:get "http://localhost:7555/contrast-agent/Some%20Body")
(select-keys @*req [:uri :path-params]))
=> nil
[nREPL-session-c670a357-7391-47a5-a979-0ddfc95f625e] INFO io.pedestal.http - {:msg "GET /contrast-agent/Some%20Body", :line 80}
=> {:uri "/contrast-agent/Some%20Body", :path-params {:arg "Some%20Body"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment