Skip to content

Instantly share code, notes, and snippets.

@ampersanda
Created February 14, 2018 16:20
Show Gist options
  • Save ampersanda/23c3694d411f298b24cc665cb6c3f202 to your computer and use it in GitHub Desktop.
Save ampersanda/23c3694d411f298b24cc665cb6c3f202 to your computer and use it in GitHub Desktop.
Default Clojure Handler for web page
;; block 1
(ns sessiontest.handler
(:require [compojure.core :refer :all]
[compojure.route :as route]
[ring.middleware.defaults :refer [wrap-defaults site-defaults]]))
;; block 2
;; this is the route part
(defroutes app-routes
(GET "/" [] "Hello World") ;; for /
(route/not-found "Not Found")) ;; 404
;; block 3
(def app
(wrap-defaults app-routes site-defaults))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment