Skip to content

Instantly share code, notes, and snippets.

@zippy
Created May 20, 2011 01:21
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 zippy/982163 to your computer and use it in GitHub Desktop.
Save zippy/982163 to your computer and use it in GitHub Desktop.
compojure problem
(ns cmp.core
(:use compojure.core, ring.adapter.jetty)
(:require [compojure.route :as route]
[compojure.handler :as handler])
)
(defn view-form []
(str "<html><head></head><body>"
"<form method=\"post\">"
"Data <input type=\"text\" name=\"data\"/>"
"<input type=\"submit\"/>"
"</form></body></html>"))
(defroutes main-routes
(GET "/" [] (view-form))
(POST "/" [data] (str "data:" data))
(route/not-found "Page not found"))
(def app
(handler/site main-routes))
(comment let [t (Thread. #(run-jetty main-routes {:port 8080}))]
(doto t .start))
(run-jetty main-routes {:port 8080})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment