-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.edn
156 lines (96 loc) · 2.78 KB
/
config.edn
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
{:roll/repl {:port 3311}
:roll/httpkit {:port 5000}
:roll/paths
[["config.edn"
{:watch roll.core/reload
:throttle 20}]]}
(comment
;; Logging
;; https://github.com/ptaoussanis/timbre#configuration
:roll/timbre
{:min-level :debug
:output-fn taoensso.timbre/default-output-fn
:appenders {:println {:min-level :info}
:spit {:fname "timbre.log"}}}
;; File watching
;;
:roll/paths
[[path1 path2 ,,,
{
;; :init my.ns/some-fn ;; (fn [{:as paths-opts :keys [paths opts]])
;; :watch my.ns/another-fn ;; (fn [changed-paths paths-opts])
;; :throttle 100 ;; watch-fn thottler in milliseconds
}]
;; add more paths as needed...
,,,]
;; Environment Variables
;;
{:some-opt #roll/env "SOME_VAR"}
;; Webserver
;;
:roll/httpkit
{
:port 5000
:handler my.project/handler
;; -- default --
;; :port 5000
;; :handler #ig/ref :roll/handler
}
;; Ring handler
;;
:roll/handler
{
;; :middleware my.project/middleware -or- [ring-middleware ...]
;; :not-found my.project/not-found-handler
;; :routes [["/some/route" my.project/handler]]
;; :sente #ig/ref :roll/sente
;; - or -
;; :handler my.project/handler
;; -- default --
;; :handler roll.handler/default-handler
;; :middleware roll.handler/default-middleware
}
;; Websockets
;;
:roll/sente
{
;; :handler my.project/event-msg-handler
;; :handshake-data-fn my.project/handshake-fn
;; :path "/chsk"
;;
;; Transit read/write handlers
;; :packer
;; {:write-handlers [datascript.transit/write-handlers ...]
;; :read-handlers [datascript.transit/read-handlers ...] }
;;
;; -- default --
;; :handler roll.sente/event-msg-handler
}
;; Task Scheduling
;;
:roll/schedule
[ ;; every 2 minutes
[2 :m my.project/some-task-fn]
;; every week
[1 :w my.project/some-other-task-fn]
;; multiple fns, and passing arguments
[1 :h
my.project/some-fn
my.project/another-fn
[my.project/yet-another-fn arg1 arg2 ,,,]]
;; possible periods
;; :ms / :s / :m / :h / :d / :w / :mt / :y
;; task fns can also return a core.async channel that can be closed
;; or will auto-close on task completion
]
;; Frontend Reloading
;; make sure to include reload.js in your html page
;; https://raw.githubusercontent.com/dimovich/reload/master/release/reload.js
:roll/reload {:css ["resources/public/css" ,,,]
:page ["resources/public/jade" ,,,]}
;; or, use Figwheel-main
;;
;; You can easily add your own config keys. Check Integrant docs at
;; https://github.com/weavejester/integrant
;;
)