Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Clojure Web Development Essentials

You're reading from   Clojure Web Development Essentials Develop your own web application with the effective use of the Clojure programming language

Arrow left icon
Product type Paperback
Published in Feb 2015
Publisher
ISBN-13 9781784392222
Length 232 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Ryan Baldwin Ryan Baldwin
Author Profile Icon Ryan Baldwin
Ryan Baldwin
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Getting Started with Luminus 2. Ring and the Ring Server FREE CHAPTER 3. Logging 4. URL Routing and Template Rendering 5. Handling Form Input 6. Testing in Clojure 7. Getting Started with the Database 8. Reading Data from the Database 9. Database Transactions 10. Sessions and Cookies 11. Environment Configuration and Deployment A. Using Korma – a Clojure DSL for SQL 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...

You have been reading a chapter from
Clojure Web Development Essentials
Published in: Feb 2015
Publisher:
ISBN-13: 9781784392222
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image