 (defn parse-transit [data]
   (let [reader (transit/reader data :json)]
     (transit/read reader)))
-
-(defn handle-action [{:keys [body]}]
-  {:status 200 :body {:action body}})
-
-(defn handle-query [{:keys [body]}]
-  {:status 200 :body {:query body}})
-
-(defn handle-not-found [_]
-  {:status 404 :body {:error "Not Found"}})
 
 (defn response-to-transit [{:keys [body headers] :as response}]
   (assoc response

(ns om-next-e2e.core
  (:require
    [bidi.ring :refer [make-handler]]
    [cognitect.transit :as transit]
    [clojure.tools.logging :as log]

  (fn [{:keys [body]}]
    (response-to-transit (call-handler handler has-body body))))

(def req-handlers {:action      (wrap-handler handlers/action true)
                   :query       (wrap-handler handlers/query true)
                   :not-found   (wrap-handler handlers/not-found false)})

(def routes ["/" {"action" {:post :action}
                  "query" {:post :query}
