summaryrefslogtreecommitdiffstats
path: root/src/app.phel
blob: ac3b94e303a41f71f71541430a62684d8a37cb36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(ns lezer.app
  (:require lezer.controller.routes)
  (:require phel.router :as r)
  (:require phel.http :as h))

(def app
  (r/handler
   (r/router
    [["/" {:handler routes/index-handler}]
     ["/ping" {:name ::ping
               :get {:handler routes/ping-handler}
               :post {:handler routes/ping-handler}}]
     ["/book" {:post {:handler routes/book-create-handler}}]])))

(when-not *build-mode*
  (h/emit-response (app (h/request-from-globals))))