Is there a reasonably simple (err.. I might mean easy) way to get a babashka webserver going which is https?
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?
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.So I want to have https, and I want to be able to manipulate and set response headers (for the CORS stuff.)
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
or simply use github pages to upload something?
oh you need local testing, got it
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
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}})
@hairfire let's continue in the #sci channel