This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-16
Channels
- # announcements (62)
- # babashka (12)
- # babashka-sci-dev (73)
- # beginners (16)
- # biff (10)
- # calva (65)
- # cider (13)
- # clerk (8)
- # clojure (31)
- # clojure-europe (16)
- # clojure-nl (1)
- # clojure-norway (19)
- # clojure-spec (24)
- # clojure-uk (5)
- # clojuredesign-podcast (18)
- # clojurescript (18)
- # dev-tooling (2)
- # emacs (30)
- # etaoin (4)
- # gratitude (3)
- # hyperfiddle (20)
- # integrant (2)
- # jobs (4)
- # kaocha (7)
- # malli (1)
- # observability (11)
- # off-topic (11)
- # pathom (12)
- # podcasts-discuss (7)
- # portal (12)
- # quil (3)
- # re-frame (6)
- # releases (1)
- # sql (22)
- # squint (5)
- # testing (79)
- # tools-deps (3)
- # xtdb (20)
Is there a relatively simple way to handle multipart form data in the babashka world? I'm using http-kit. It looks like ring isn't compatible with babashka so I've been avoiding that. It could handle multipart form data otherwise
I've been able to use ring successfully in babashka after finding this gem: https://clojurians-log.clojureverse.org/babashka/2023-05-01/1682944876.150579 I have not tried form-params yet, but the parts I use are working well.
I managed to get a client side to work with http-kit:
@(http/post url
{:multipart [{:name "file" :content content :filename filename}]
:oauth-token token
:insecure? true
:headers {"Content-Type" "multipart/form-data" "Accept" "application/json"}})
In bb.cli there is a nice require function which is described here: https://github.com/babashka/cli#require When I use it I get that and a bunch more:
---- Error --------------------------------------------------------------------
Type: clojure.lang.ExceptionInfo
Message: Required option: :ratio
Data: {:spec {:video {:alias [...]
Location:
---- Context -----
[...]
---- Stack trace ----
[...]
This is a good error message for me as the developer but it's too much to show users. Is there a way to only show Required option: :ratio
or even better Required option: --ratio
?Has anyone tried and successfully run a web app with Babashka in combination with htmx and server sent events? It seems I can't figure out how to run a web server (I tried http-kit) to properly setup and communicate to the browser and htmx using server sent events.
there is a ring middleware for sse here, I haven't tried it with httpkit + bb, but if you have a work-in-progress little project, I could give it a stab locally https://github.com/kumarshantanu/ring-sse-middleware/blob/master/src/ring_sse_middleware/adapter/http_kit.clj