This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-28
Channels
- # announcements (13)
- # babashka (7)
- # beginners (35)
- # calva (23)
- # chlorine-clover (6)
- # cider (12)
- # clj-kondo (6)
- # clojure (31)
- # clojure-dev (20)
- # clojure-europe (4)
- # clojure-norway (4)
- # clojure-uk (1)
- # clojurescript (62)
- # fulcro (6)
- # google-cloud (1)
- # lsp (2)
- # malli (13)
- # meander (6)
- # music (1)
- # off-topic (19)
- # practicalli (2)
- # re-frame (7)
- # reagent (25)
- # reitit (5)
- # releases (1)
- # reveal (3)
- # shadow-cljs (90)
- # tools-build (18)
- # tools-deps (1)
If anyone is interested, I've put together a very simple example of using reitit + sente + plain ol'javascript (client) as a demonstration of websockets working between a javascript client and a clojure backend. Links are:
and
. The projects are not sophisticated (i.e., no authentication apart from a simple, non-secure, csrf check). It's merely to show a starting point. Enjoy!
this is excellent! thank you!
You're most welcome. I've updated the repo just to tidy up some things and to link to the javascript client.
Hey folks, I'm having a bit of trouble getting the body-params out of muuntaja in my ring router. I practically lifted it from the reitit examples in the repo, but everytime the body-params (x and y) are nil. Anyone see any issues with my router?
(def router
(ring/ring-handler
(ring/router
[["/plain"
["/plus" {:get (fn [{{:strs [x y]} :query-params :as req}]
{:status 200
:body {:total (+ (Long/parseLong x) (Long/parseLong y))}})
:post (fn blah [{{:keys [x y]} :body-params}]
{:status 200
:body {:total (+ x y)}})}]]]
{:data {:coercion reitit.coercion.spec/coercion
:muuntaja m/instance
:middleware [parameters/parameters-middleware
muuntaja/format-middleware
coercion/coerce-exceptions-middleware
coercion/coerce-request-middleware
coercion/coerce-response-middleware]}})
(ring/create-default-handler)))