This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-19
Channels
- # alda (1)
- # announcements (2)
- # babashka (14)
- # beginners (30)
- # biff (12)
- # clerk (2)
- # clj-kondo (18)
- # clj-on-windows (1)
- # clojure (98)
- # clojure-europe (9)
- # clojure-gamedev (4)
- # clojurescript (39)
- # conjure (1)
- # data-science (1)
- # emacs (25)
- # events (1)
- # fulcro (1)
- # hyperfiddle (13)
- # lsp (3)
- # malli (1)
- # membrane (10)
- # off-topic (12)
- # reagent (7)
- # scittle (21)
- # shadow-cljs (10)
I think I saw an example of a on-liner babashka script to serve files via http, like the infamous python -m SimpleHTTPServer but I am not finding it anymore.
https://github.com/babashka/http-server/ you can install it with bbin:
bbin install org.babashka/http-server --mvn/version 0.1.11
There is no built-in file server in bb so you will need to use that dependency in your bb.edn
or install it via bbin (#C0400TZENE7)
on that note @U04V15CAJ since we are jdk 19+, would it be worth to have something in bb based on https://blogs.oracle.com/javamagazine/post/java-18-simple-web-server
jshell> var handler = SimpleFileServer.createFileHandler(Path.of("/some/path"));
jshell> var server = HttpServer.create(new InetSocketAddress(8080),
...> 10, "/somecontext/", handler);
jshell> server.start();
right, i was thinking more in terms this should deprecate the need for https://github.com/babashka/http-server/ ?
but if its too much binary size, yeah not worth it
@U7ERLH6JX an alternative is to include the source of bb http-server (like what's been done with spec.alpha): this would only increase the binary with 10kb or so while still having the convenience of doing bb -m babashka.http-server
without including additional deps
Odd that v0.2.16
is considered the https://github.com/babashka/fs/releases on GitHub :thinking_face:
What’s the logic? Anything needed in the build-step?
@U04V6FEES not sure what happened but I think it's fixed now