Skip to content

Adding a goodbye routeλ︎

Note::Add another route to display a goodbye messageλ︎

(defroutes app
  (GET "/" [] welcome)
  (GET "/goodbye" [] goodbye)
  (not-found "Sorry, page not found"))

Note::Write the handler function for the goodbye routeλ︎

(defn goodbye
  "A song to wish you goodbye"
  [request]
  {:status 200
   :headers {}
   :body "<h1>Walking back to happiness</h1>
          <p>Walking back to happiness with you</p>
          <p>Said, Farewell to loneliness I knew</p>
          <p>Laid aside foolish pride</p>
          <p>Learnt the truth from tears I cried</p>"})

Now test your new route.

As we have wrap-reload around app then no restart needed