Skip to content

Instantly share code, notes, and snippets.

@bobo
Created August 28, 2010 19:45
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 bobo/555496 to your computer and use it in GitHub Desktop.
Save bobo/555496 to your computer and use it in GitHub Desktop.
(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