       body]
      (page/include-js "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js")]))
 
+(defn post-form []
+  (page-layout
+    "Post to Screen"
+    [:h1 "Post to Screen"]
+    (form/form-to {:role "form"}
+                  [:post "/posts"]
+                  [:div.form-group
+                   (form/text-area {:class "form-control" :rows 20} "code")]
+                  (form/submit-button {:class "btn btn-primary"} "Post code"))))
+
+; Show code
 
 (defn code-layout [title & body]
   (page/html5

            [ring.adapter.jetty :refer [run-jetty]]
            [hiccup.page :as page]
            [hiccup.form :as form]
            [hiccup.util :as util]))

(defn page-layout [title & body]
  (page/html5

(defroutes routes
  (resources "/")
  (resources "/react" {:root "react"})

  (GET "/" [_] (post-form))

  (GET  "/posts" [_] (show-posts))
  (POST "/posts" [code] (post-code code))

  (GET "/posts/:id" [id] (show-code id))

  #_(GET "/*" req (page)))

(def http-handler
  (if is-dev?
