Skip to content

Instantly share code, notes, and snippets.

@ponkore
Created March 15, 2012 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ponkore/2043639 to your computer and use it in GitHub Desktop.
Save ponkore/2043639 to your computer and use it in GitHub Desktop.
Hello, Compojure #1
(ns compojure-example.core
(:use compojure.core
[hiccup.middleware :only (wrap-base-url)])
(:require [compojure.route :as route]
[compojure.handler :as handler]))
(defn index-page [] "<H1>Hello, world</H1>")
(defroutes main-routes
(GET "/" [] (index-page))
(route/resources "/")
(route/not-found "Page not found"))
(def app
(-> (handler/site main-routes)
(wrap-base-url)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment