Book Image

Clojure Web Development Essentials

By : Ryan Baldwin
Book Image

Clojure Web Development Essentials

By: Ryan Baldwin

Overview of this book

Table of Contents (19 chapters)
Clojure Web Development Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Environ


Luminus-generated applications make use of the environ library, which was written by James Reeves, the essential Godfather of Clojure web development (remember, this guy wrote Ring, the Ring Server, and about every other underpinning library we've used in this book). The environ library allows applications to read environment variables set from outside the scope of any internalized configuration. This is important to remember: environ accepts environment configurations only from outside the application, thus adhering to the third tenant (Configuration) of the 12 Factor-Application Pattern.

Note

You can read more about the 12 Factor-Application Pattern at http://12factor.net. While not necessary for this chapter, it's something I encourage any software developer to read, as the practices contained within are beneficial for any software you're writing.

Using environ

Consuming environment configuration through environ is trivial. Let's assume we have an environment variable called DB_USER...