Create a gist now

Instantly share code, notes, and snippets.

@bobo /core.clj
Created Aug 28, 2010

What would you like to do?
(ns SimpleTasks.core
(:use compojure.core,hiccup.core,hiccup.form-helpers ring.adapter.jetty))
(defn display []
(html [:h1 "hello world!"]))
(defn render-form []
(html
(form-to [:post "/" ]
"Add task"
[:br]
(text-field :task)
(submit-button "save"))))
(defroutes myroutes
(GET "/" [] (display))
(GET "/form" [] (render-form)))
(defonce server (run-jetty #'myroutes
{:join? false
:port 8080}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment