Todo-it is a sample Pedestal application developed from scratch. Read more information below, or in the accompanying slides.
A video workshop walking through the construction of this project is available in my O'Reilly webcast Building Web Applications in Clojure.
- Install JDK 7+
- Install the Leiningen build tool
- Clone this repository (
git clone https://github.com/rkneufeld/pedestal-workshop
)
Inside pedestal-workshop/
, run the command lein run
. The first
time you run this command Leiningen will fetch and install all of the
application's dependencies.
Once the application starts, you will see something like the following:
$ lein run
INFO org.eclipse.jetty.util.log - Logging initialized @10299ms
INFO org.eclipse.jetty.server.Server - jetty-9.1.3.v20140225
INFO o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@6d0433ee{/,null,AVAILABLE}
INFO o.e.jetty.server.ServerConnector - Started ServerConnector@32af198c{HTTP/1.1}{0.0.0.0:8080}
INFO org.eclipse.jetty.server.Server - Started @10431ms
At this point, the application is ready. Visit or cURL http://localhost:8080/hello to verify the application is running properly (all but the very first commit should respond).
If you've built or checked-out the final version of the application, visit http://localhost:8080/todos to see it in action.
The slides for following along with this workshop are available at https://speakerdeck.com/rkneufeld/web-apps-on-a-pedestal.
Branches exist for each exercise, allowing you to git checkout checkpoint-x
and start with a clean, working state.
Checkpoint branches are:
- exercise-1 - Basic application with only /hello
- exercise-2 - /hello?name=You!
- exercise-3 - Heroku deployable application
- exercise-4 - Transient persistence via in-memory Datomic (todoit.todo.db)
- exercise-5 - /todos with a stubbed TODO form
- exercise-6 - Bootstrap paint job!
- exercise-7 - Finally, /todos can create, read, update, and destroy TODOs.
Copyright © 2014 Ryan Neufeld
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.