Created
September 17, 2011 14:18
-
-
Save mkwiatkowski/1223974 to your computer and use it in GitHub Desktop.
Compojure hello world application
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
(ns helloworld | |
(:gen-class) | |
(:use compojure.core | |
ring.adapter.jetty | |
clojure.contrib.command-line) | |
(:require [compojure.route :as route])) | |
(defroutes main-routes | |
(GET "/" [] "<h1>Hello World</h1>") | |
(route/not-found "<h1>Page not found</h1>")) | |
(defn -main [& args] | |
(with-command-line args | |
"Application" | |
[[port "Port to run the server on"]] | |
(run-jetty main-routes {:port (Integer/parseInt port)}))) |
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
(defproject helloworld "0.1" | |
:dependencies [[org.clojure/clojure "1.2.1"] | |
[org.clojure/clojure-contrib "1.2.0"] | |
[compojure "0.6.5"] | |
[ring/ring-jetty-adapter "0.3.11"]] | |
:main helloworld) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment