babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
bherrmann 2021-06-24T15:07:10.171700Z

Is there a reasonably simple (err.. I might mean easy) way to get a babashka webserver going which is https?

Tomas Brejla 2021-06-24T15:22:20.172400Z

Good question. Babashka itself includes HttpKit as a server, which itself suggests using reverse proxy such as Nginx to provide HTTPS support. If you wanted to try to spawn https server yourself manually, then I'm affraid you'd need classes in javax.net.ssl package (SSLServerSocket, KeyManager, TrustManager and many other) to be present in babashka . They don't seem to be present in babashka. Btw, what's your use case for having such "inlined", totally-standalone https server?

bherrmann 2021-06-24T15:29:26.172600Z

Well, I want to host some html/javascript and I'm lazy. So my first thought was

bb <http://somethingWebServer.bb|somethingWebServer.bb> fileToHost.html
where I can access said file at,
$ open <https://localhost:4444/>
I need https because I'm fiddling with CORS and I'm trying to model a problem I'm having at in a larger system.

bherrmann 2021-06-24T15:31:06.172900Z

So I want to have https, and I want to be able to manipulate and set response headers (for the CORS stuff.)

lukasz 2021-06-24T15:31:26.173100Z

I'd second using a reverse proxy, for your usecase - you can use caddy which can provision a let's encrypt cert for you with one command, no configs needed: https://caddyserver.com/docs/quick-starts/reverse-proxy

borkdude 2021-06-24T15:31:44.173500Z

or simply use github pages to upload something?

borkdude 2021-06-24T15:32:07.173700Z

oh you need local testing, got it

kokada 2021-06-24T19:37:04.173900Z

Can also use something like ngrok if you aren't too paranoic with security (since this is for development, should be fine): https://ngrok.com/docs/2

hairfire 2021-06-24T21:39:49.175100Z

Is there a way to generate bindings from a call to "ns-publics" for the options passed to "sci/eval-string"? I tried just passing the result of calling "ns-publics" for the value associated with ":bindings", but it doesn't work. In "sci"'s documentation there's the following example:

(sci/eval-string "(println \"hello\")" {:bindings {'println println}})

borkdude 2021-06-24T21:43:02.175600Z

@hairfire let's continue in the #sci channel