-
Notifications
You must be signed in to change notification settings - Fork 0
/
core.clj
34 lines (29 loc) · 1.13 KB
/
core.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
(ns firma-analysis.ports.http-in.core
(:require [firma-analysis.configs :as configs]
[firma-analysis.ports.http-in.routes.core :as routes]
[io.pedestal.http :as http]
[io.pedestal.http.route :as route]))
(def service {:env (keyword configs/env)
::http/routes routes/specs
::http/resource-path "/public"
::http/type :jetty
::http/port 8080
::http/container-options {:h2c? true
:h2? false
:ssl? false}})
(defonce runnable-service (http/create-server service))
(defn start
[]
(http/start runnable-service))
(defn start-dev
[]
(-> service
(merge {:env :dev
::http/join? false
::http/routes #(route/expand-routes (deref #'routes/specs))
::http/allowed-origins {:creds true :allowed-origins (constantly true)}
::http/secure-headers {:content-security-policy-settings {:object-src "'none'"}}})
http/default-interceptors
http/dev-interceptors
http/create-server
http/start))