aboutsummaryrefslogtreecommitdiff
path: root/src/clj/queue_api/handler.clj
blob: 97afd4899cca401136d4adebfdb2f85f2658c7ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
(ns queue-api.handler
  (:require [compojure.core :refer [routes wrap-routes]]
            [queue-api.routes.services :refer [service-routes]]
            [compojure.route :as route]
            [queue-api.env :refer [defaults]]
            [mount.core :as mount]
            [queue-api.middleware :as middleware]))

(mount/defstate init-app
  :start ((or (:init defaults) identity))
  :stop  ((or (:stop defaults) identity)))

(mount/defstate app
  :start
  (middleware/wrap-base
    (routes
          #'service-routes
      (route/not-found
        "page not found"))))