(ns lezer.app (:require lezer.controller.routes) (:require phel.router :as r) (:require phel.http :as h)) (def- router (r/router [["/" {:handler (fn [req] (routes/index-handler req router))}] ["/ping" {:name ::ping :get {:handler routes/ping-handler} :post {:handler routes/ping-handler}}] ["/book" {:post {:handler routes/book-create-handler}}] ["/author/{id}" {:name :author :get {:handler routes/author-view-handler}}]])) (def app (r/handler router)) (when-not *build-mode* (h/emit-response (app (h/request-from-globals))))