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

Configuring and running the Ring Server


There are two ways you can run the Ring Server. The first is by loading the hipstr.repl namespace into a REPL and calling start-server. The second is from the command line (which we've seen earlier):

# lein ring server

In either case, an embedded Jetty server will be spun up to serve our application handler, and a browser will pop open. If you don't want the browser to open, you can run the server in the headless mode:

# lein ring server-headless

How we start the server determines how we configure the server. We've already seen how to configure the server when running through the REPL (by adjusting the options map that's passed as part of the call to ring.server.standalone/serve), but how do we configure the server if running from the command line?

The lein ring command is made available through the lein-ring plugin. Luminus includes this plugin when generating the project for us. In our project dependencies file (project.clj), you'll see the following...