Adding a page to the web application

As an exercise, let's add a new page to the application. Here are the requirements:

  • The page's URL must be /monadtest
  • It should make use of the existing home-routes route. This route calls middleware that protects the application against specific web attacks.
  • It will use an HTML page with a form that renders the entered text using the pretty-msg function

The page will make use of the pretty-msg function that we wrote in the Exploring Monads section.

In the project.clj build file, add the org.clojure/algo.monads dependency by copying and pasting its dependency line from the exploring-monads/project.clj file to the dependencies section of the myapp/project.clj file. After saving the file, Counterclockwise ...

Get Introduction to JVM Languages now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.