Adding a goodbye route

Add another route to display a goodbye message

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

Dont forget to write the handler function for the goodbye route

(defn goodbye
  "A song to wish you goodbye"
  [request]
  {:status 200
   :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>"
   :headers {}})

Now test your new route. As we have wrap-reload around app then no restart needed

results matching ""

    No results matching ""