Skip to content

Instantly share code, notes, and snippets.

View pearigee's full-sized avatar

Gabe Pearhill pearigee

View GitHub Profile
@holyjak
holyjak / http-server.bb
Last active May 20, 2025 08:49
Babashka HTTP server for serving static files, similar to `python -m http.server` but more flexible :)
#!/usr/bin/env bb
#_" -*- mode: clojure; -*-"
;; Based on https://github.com/babashka/babashka/blob/master/examples/image_viewer.clj
(ns http-server
(:require [babashka.fs :as fs]
[clojure.java.browse :as browse]
[clojure.string :as str]
[clojure.tools.cli :refer [parse-opts]]
[org.httpkit.server :as server]