   (edn/read-string {:readers *data-readers*} (prn-str edn)))
 
 (defn get-doc [eid]
+  (pprint (type eid))
   (let [doc-tx (d/pull (d/db conn) '[*] eid)
-        doc-html (tx->html doc-tx)]))
+        doc-html (tx->html doc-tx)]
+    (pprint doc-tx)
+    {:status 200
+     :headers {"Content-Type" "application/hal+json; charset=utf-8"}
+     :body doc-html}))
 
 (defn post-doc [doc-string]
  (let [tx (-> (html->tx doc-string) (add-tempid) (edn->clj))
        [eid db-after] (save-arb-tx tx)
        tx-from-db (d/pull db-after '[*] eid)
        html (-> tx-from-db (tx->arb) (arb->hiccup) (html))]
+   (pprint (type eid))
    {:status 201
     :headers {"Content-Type" "application/hal+json; charset=utf-8"}
     :body {:_links {:self (apply str "/documents/" (str eid))}


(defroutes app-routes
  (GET "/" [] {:body {:_links {:documents {:href "/docs"}}}})
  (POST "/documents" [doc-string] (post-doc doc-string))
  (route/not-found "Not found"))

(def app
  (-> app-routes
      (wrap-json-response)
      (wrap-defaults api-defaults)))


        datemo.arb)
  (:require [clojure.edn :as edn]
            [compojure.route :as route]
            [ring.middleware.json :refer :all]
            [ring.middleware.defaults :refer [wrap-defaults api-defaults]]
            [datomic.api :as d]))

