|
|
|
|
|
|
23
|
:headers {"Content-Type" "text/html"}
|
23
|
:headers {"Content-Type" "text/html"}
|
|
24
|
:body (html [:form#query {:action "/facts" :accept-charset "utf-8"}
|
24
|
:body (html [:form#query {:action "/facts" :accept-charset "utf-8"}
|
|
25
|
[:textarea {:name "q" :cols 80 :rows 20}]
|
25
|
[:textarea {:name "q" :cols 80 :rows 20}]
|
|
26
|
[:input {:type "submit"alue "query"}]])})
|
|
|
|
|
|
26
|
[:input {:type "submit" :value "query"alue "query"}]]
|
|
|
|
27
|
[:form#facts {:action "/facts" :method "post"}
|
|
|
|
28
|
[:textarea {:name "facts" :cols 80 :rows 20}]
|
|
|
|
29
|
[:input {:type "submit" :value "transact!"}]])})
|
|
27
|
(GET "/facts" {{query :q} :params}
|
30
|
(GET "/facts" {{query :q} :params}
|
|
28
|
(pr-str (d/q (edn/read-string query) (d/db conn))))
|
31
|
(pr-str (d/q (edn/read-string query) (d/db conn))))
|
|
29
|
(POST "/facts" [facts]
|
32
|
(POST "/facts" [facts]
|