This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-14
Channels
- # beginners (74)
- # boot (1)
- # cider (6)
- # clj-kondo (8)
- # cljs-dev (30)
- # clojure (195)
- # clojure-ecuador (1)
- # clojure-europe (2)
- # clojure-italy (51)
- # clojure-nl (47)
- # clojure-spec (9)
- # clojure-sweden (27)
- # clojure-uk (63)
- # clojurescript (84)
- # cursive (41)
- # datascript (17)
- # datomic (16)
- # docker (1)
- # emacs (10)
- # events (2)
- # graalvm (2)
- # graphql (37)
- # juxt (2)
- # nrepl (20)
- # nyc (2)
- # off-topic (26)
- # onyx (3)
- # pedestal (4)
- # perun (19)
- # planck (1)
- # reagent (9)
- # reitit (4)
- # shadow-cljs (208)
- # spacemacs (6)
- # tools-deps (4)
I would say Pedestal is a framework, as it calls your code 😉 There is also reitit-pedestal
add-on, which allows one to describe header-params with spec. With request-coercion interceptor mounted, validation, coercion (string->edn) and api-docs are pulled from those definitions. Would be something like:
["/headers"
{:get {:summary "playing with header-params"
:parameters {:header {:x-int pos-int?}}
:interceptors [(coercion/coerce-request-interceptor)]
:handler (fn [req]
{:status 200
:body {:value (-> req :parameters :header :x-int inc)}})}}]
question about web sockets.. Is there a simple way to know which client closed their end so that I can remove them from my collection of clients? I've done some workarounds requiring the client to have an id as a query param and I can look them up by request on close, but I was hoping there was something simpler that I've been overlooking.