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 Application

To create the application we’ll open Eclipse and then select a new Leiningen project. We’ll set the project name to picture-gallery and change our profile from default to compojure-app. If needed, please refer to Chapter 1, Getting Your Feet Wet, for more details on how to complete this step. We’ll use PostgreSQL as our database, so we’ll need to add the necessary dependencies to our project. Once your project has been initialized, open the project.clj and add the postgresql, clojure.java.jdbc, and lib-noir dependencies.

picture-gallery-a/project.clj
 
[postgresql/postgresql ​"9.1-901.jdbc4"​]
 
[org.clojure/java.jdbc ​"0.2.3"​]
 
[lib-noir ​"0.8.2"​]

Since we’re using lib-noir, we have to add its middleware to our handler ...

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