Exercise #1 1. Install Leiningen (http:/ /leiningen.org/#install) 2. git clone https:/ /github.com/rkneufeld/pedestal-workshop 3. Checkout exercise-1 4. Run the app w/ lein run 5. Visit localhost:8080/hello 6. Change “Hello, World!” to “Hello, !”* *You’ll need to restart the server
Exercise #2 1. Checkout exercise-2 2. Restart your server w/ lein run 3. Visit localhost:8080/hello?name= 4. Use the (or x y) form to provide "World" as a default name if none is provided. 5. Bonus: Write a defon-response interceptor that changes :header’s "Server" key to something unique of your choosing.
Exercise #4 1. Checkout exercise-4 2. Launch a REPL w/ lein repl 3. Require and enter todoit.todo.db • (require 'todoit.todo.db) • (in-ns 'todoit.todo.db) 4. Create, Read, Update, then Destroy a TODO • Get a db value with (d/db conn) 5. Bonus: Write a query completed-todos that ensures [?id :todo/completed? true]
Exercise #5 1. Checkout exercise-5 2. Try out /todos 3. Implement and wire-up a create function in todo.clj Hint: Use let à la hello-world to extract [:form-params “title”] and [:form-params “description”]. Once you’ve created a TODO, redirect to (url-for :todos).
Exercise #6 1. Checkout exercise-6 2. Try out the new /todos 3. Add a TODO without a title. Oops! 4. Modify the TODO form’s title to be required (hint, the required attribute).
Exercise #7 1. Checkout exercise-7 2. Try out toggling and deleting TODOs 3. Create a delete-all action. You’ll need a: • Route, • Handler, • Model Action, and • Form