This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-03
Channels
- # announcements (35)
- # aws (20)
- # babashka (4)
- # beginners (88)
- # cider (9)
- # clara (1)
- # clj-kondo (6)
- # cljsrn (3)
- # clojure (107)
- # clojure-dev (7)
- # clojure-europe (99)
- # clojure-nl (3)
- # clojure-spec (9)
- # clojure-uk (2)
- # clojurescript (28)
- # core-async (53)
- # cursive (11)
- # datascript (1)
- # datomic (2)
- # emacs (20)
- # fulcro (3)
- # graalvm (4)
- # holy-lambda (18)
- # jobs (1)
- # kaocha (7)
- # leiningen (2)
- # lsp (25)
- # luminus (1)
- # membrane-term (52)
- # missionary (8)
- # nextjournal (19)
- # off-topic (16)
- # other-languages (3)
- # podcasts-discuss (2)
- # polylith (23)
- # re-frame (4)
- # reclojure (6)
- # remote-jobs (1)
- # rewrite-clj (36)
- # ring (1)
- # sci (10)
- # shadow-cljs (7)
- # spacemacs (5)
- # sql (20)
- # uncomplicate (1)
- # vscode (3)
- # xtdb (27)
Idea
Now holy-lambda-adapter
supports ring style handlers, so that you can use Ring with HL.
(defn ring-handler
[request]
{:status 200
:headers {}
:body \"Hello World\"}
(def HttpApiProxyGateway (hlra/wrap-hl-req-res-model ring-handler))
(h/entrypoint [#'HttpApiProxyGateway])
I'm wondering whether adapter should support also a reversed conversion for development. Something like allowing HL handlers run on ring server.
(defn hl-style-handler
[request]
{:statusCode 200
:headers {}
:body {:something "something"}
(jetty/run-server (hlra/adapt-to-ring hl-style-handler) {})
@U0510KXTU I expect your input here since you already were doing something like this for yourself. Would you use the official library if that would be possible? 🙏
Isn't pedestal somewhat compatible with Ring?
Actually having an adapter for Pedestal would be cool
Do you have experience in shaping correct request for pedestal?
Here is what is done for Ring: https://github.com/FieryCod/holy-lambda-ring-adapter/blob/master/src/fierycod/holy_lambda_ring_adapter/core.cljc#L9
Wondering how much would have to change 😄
Then we would have to reverse the conversion for local server as well, but yeah. I think it's doable
Yeah. That would be cool. I would not have to implement interceptors (which are quite hard to implement if you want to be compatible with babashka) 😄