O'Reilly logo

Web Development with Clojure by Dmitri Sotnikov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the Project

In this section we’ll cover how to create a simple application that serves static resources, provides basic session management, and handles JavaScript Object Notation (JSON) operations.

First let’s create a new application called liberator-service using the compojure-app template.

 
lein new compojure-app liberator-service

Once the application is created, add Liberator and Cheshire dependencies to our project.clj dependencies vector:[40]

 
:dependencies
 
[ ​..​​.
 
[liberator ​"0.11.0"​]
 
[cheshire ​"5.3.1"​]]

Cheshire is a fast and easy-to-use JSON parsing library. We’ll use it for parsing the requests from the client and generating the responses.

At this point, we should be able to start up the read-evaluate-print ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required