DEV Community

loading...

Read environment variables in Clojure

Cora Sutton
keyboard cowgirl, baby hacktress
・1 min read

Do you want to load some configuration values from the environment in Clojure?

Great news! Clojure makes this easy!

(System/getenv "SHELL")
;=> /usr/local/bin/zsh
Enter fullscreen mode Exit fullscreen mode

There are many other ways to configure your Clojure application, and some of us have our favorites, but environment variables often factor in.

Give it a shot and see what you can learn!

Discussion (0)