In a previous post, we setup a really simple route and server executing some Clojure code for us. In today’s post, we’re going to use a library called Compojure to fancy-up a little bit of that route definition.
This should make defining our web application a bit more fun, anyway.
Getting started
Again, we’ll use Leiningen to kick our project off:
We’re going to add some dependencies to the project.clj folder for compojure and http-kit. http-kit is the server that we’ll be using today.
And then, installation.
Hello!
To get started, we’ll define a root route to greet us.
A quick hit through curl lets us know that we’re up and running: