Minor presentational cleanup.
This commit is contained in:
parent
f27106a996
commit
1c2c8bc238
10 changed files with 44 additions and 67 deletions
|
|
@ -1,40 +0,0 @@
|
|||
(ns geocsv.handler
|
||||
(:require [compojure.core :refer [routes wrap-routes]]
|
||||
[geocsv.env :refer [defaults]]
|
||||
[geocsv.middleware :as middleware]
|
||||
[geocsv.layout :refer [error-page]]
|
||||
[geocsv.routes.home :refer [home-routes]]
|
||||
[geocsv.routes.json :refer [json-routes]]
|
||||
[reitit.ring :as ring]
|
||||
[ring.middleware.content-type :refer [wrap-content-type]]
|
||||
[ring.middleware.webjars :refer [wrap-webjars]]
|
||||
[mount.core :as mount]))
|
||||
|
||||
(mount/defstate init-app
|
||||
:start ((or (:init defaults) (fn [])))
|
||||
:stop ((or (:stop defaults) (fn []))))
|
||||
|
||||
(mount/defstate app-routes
|
||||
:start
|
||||
(ring/ring-handler
|
||||
(ring/router
|
||||
[(home-routes)
|
||||
;; (-> #'json-routes
|
||||
;; (wrap-routes middleware/wrap-csrf)
|
||||
;; (wrap-routes middleware/wrap-formats))
|
||||
])
|
||||
(ring/routes
|
||||
(ring/create-resource-handler
|
||||
{:path "/"})
|
||||
(wrap-content-type
|
||||
(wrap-webjars (constantly nil)))
|
||||
(ring/create-default-handler
|
||||
{:not-found
|
||||
(constantly (error-page {:status 404, :title "404 - Page not found"}))
|
||||
:method-not-allowed
|
||||
(constantly (error-page {:status 405, :title "405 - Not allowed"}))
|
||||
:not-acceptable
|
||||
(constantly (error-page {:status 406, :title "406 - Not acceptable"}))}))))
|
||||
|
||||
(defn app []
|
||||
(middleware/wrap-base #'app-routes))
|
||||
|
|
@ -22,6 +22,7 @@
|
|||
template
|
||||
(assoc params
|
||||
:page template
|
||||
:version (System/getProperty "geocsv.version")
|
||||
:csrf-token *anti-forgery-token*)))
|
||||
"text/html; charset=utf-8"))
|
||||
|
||||
|
|
|
|||
|
|
@ -27,8 +27,7 @@
|
|||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(def default-db
|
||||
{:page :home
|
||||
:available-pin-images #{"Planning-authority"
|
||||
{:available-pin-images #{"Planning-authority"
|
||||
"Landowner"
|
||||
"Unknown"
|
||||
"Anchor-customer"
|
||||
|
|
@ -38,4 +37,6 @@
|
|||
"Other-key-customers"
|
||||
"Power-supplier"} ;; need to be fetched from server side
|
||||
:latitude 56
|
||||
:longitude -4})
|
||||
:longitude -4
|
||||
:page :home
|
||||
:zoom 1})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue