Skip to content

Instantly share code, notes, and snippets.

@ponkore
Created March 15, 2012 11:47
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/2043831 to your computer and use it in GitHub Desktop.
Save ponkore/2043831 to your computer and use it in GitHub Desktop.
Hello, Compojure #2
(ns compojure-example.core
(:use compojure.core
ring.adapter.jetty ; <- added
[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"))
;;; deleted
;(def app
; (-> (handler/site main-routes)
; (wrap-base-url)))
;;; added
(run-jetty main-routes {:port 8080 :join? false})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment