A dead-simple link shortener written in Clojure.
- Fun.
- Minimal dependencies.
- Something I can self-host.
- Play with Fly.io.
- Nice reminders of recently created links!
For now, cby.li runs on Fly.io. In theory, it can run anywhere you can run Docker. Just set the right environment variables and you're good to go:
BASE_URL=https://cby.li
ENV=production
PORT=9002
The values noted above are the defaults.
To deploy, just do:
fly deploy
In short, the deployed app runs a Docker container that in turn runs the compiled Clojure app.
The app is compiled as an uberjar, i.e. the compiled clojure code and its runtime dependencies (including assets). The build process uses tools.build to build the uberjar. See Dockerfile and build.clj
for details: both are extremely simple.
BASE_URI=http://localhost:9002 ENV=dev clojure -M:repl
- Favicon