Created
October 12, 2022 04:36
-
-
Save oitee/f8a738af34bf3b379f5bc7aa514f7e7d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn handler-that-supports-multiple-routes | |
[{:keys [uri request-method] :as request}] | |
request | |
(cond | |
(and (= uri "/contact") | |
(= request-method :get)) | |
{:status 200 | |
:headers {} | |
:body "Contact us at [email protected]"} | |
(and (= uri "/home") | |
(= request-method :get)) | |
{:status 200 | |
:headers {} | |
:body "Hello World!"} | |
:else | |
{:status 404 | |
:headers {} | |
:body "Not found!"})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment