Skip to content

Instantly share code, notes, and snippets.

@henryw374
Last active July 5, 2022 09:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henryw374/64cd72c243feae85c31947d35ad90278 to your computer and use it in GitHub Desktop.
Save henryw374/64cd72c243feae85c31947d35ad90278 to your computer and use it in GitHub Desktop.
babashka adhoc file server
#!/usr/bin/env bb
; run the script from any dir to serve its files
(require '[babashka.deps])
(def deps '{:deps {io.github.babashka/http-server
{:git/sha "b38c1f16ad2c618adae2c3b102a5520c261a7dd3"}}})
(babashka.deps/add-deps deps)
(require '[babashka.http-server :as http])
(http/serve {:port 8080 :dir "."})
(println "Serving static assets at http://localhost:8080")
@(promise)
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment