Anyone have an example of reagent.dom.server working in babashka?
Hehe nevermimd, reagent.dom.server is a cljs file 😛
Has someone managed to run a ring or httpkit server with bb in docker? I want to try it on aws fargate.
How can I get the CWD easily in bb?
(System/getProperty "user.dir")
would this help? https://github.com/babashka/babashka/blob/master/examples/file-server.clj
Yes, httpkit is built in so that shouldn't be a problem :)
Thank you!
This will likely help, will have a look. Now to create the docker file : )
Which version of httpkit is built in bb? I can't seem to be able to stop the server with /server-stop!
getting some protocol error.
@dennisa I think the newest one. I'm getting the same error with clojure
:
$ clojure -Sdeps '{:deps {http-kit/http-kit {:mvn/version "2.5.3"}}}' -M /tmp/httpkit.clj
Syntax error (IllegalArgumentException) compiling at (/tmp/httpkit.clj:3:1).
No implementation of method: :-server-stop! of protocol: #'org.httpkit.server/IHttpServer found for class: clojure.lang.AFunction$1
@dennisa It seems it works like this:
(def server (srv/run-server (fn [_])))
(server)
(def server (srv/run-server (fn [_])))
(server :timeout 100)
It seems the return value depends on:
If :legacy-return-value? is
true (default) ; Returns a (fn stop-server [& {:keys [timeout] :or {timeout 100}}])
false (recommended) ; Returns the HttpServer which can be used with `server-port`,
; `server-status`, `server-stop!`, etc.