Prepare for development
This commit is contained in:
parent
06419e22b4
commit
d5eded5a67
1 changed files with 23 additions and 4 deletions
|
@ -1,10 +1,29 @@
|
||||||
(ns rss-thread-watch.core
|
(ns rss-thread-watch.core
|
||||||
(:gen-class)
|
(:require [ring.adapter.jetty :as jetty])
|
||||||
(:require ))
|
(:gen-class))
|
||||||
|
|
||||||
|
|
||||||
|
;; Internal default config
|
||||||
|
(def CONFIG
|
||||||
|
"Internal default config"
|
||||||
|
{:target "https://api.4chan.org/mlp/catalog.json" ;Where to download catalog from
|
||||||
|
:start-index-at 50.0 ;We will search all threads that are lower in catalog than this % value
|
||||||
|
:refresh-delay (* 60 5) ;Redownload catalog every 5 mins
|
||||||
|
:port 6969 ;Liston on 6969
|
||||||
|
})
|
||||||
|
|
||||||
(defn -main
|
(defn -main
|
||||||
"Entry point, starts webserver"
|
"Entry point, starts webserver"
|
||||||
[& args]
|
[& args]
|
||||||
()
|
())
|
||||||
|
|
||||||
|
(defn handler [rqst]
|
||||||
|
{:status 404
|
||||||
|
:header {"Content-Type" "text/html"}
|
||||||
|
:body "No poines here ^:("})
|
||||||
|
|
||||||
|
;; Docs: https://github.com/ring-clojure/ring/wiki/Getting-Started
|
||||||
|
(defn repl-main
|
||||||
|
[]
|
||||||
|
(jetty/run-jetty handler {:port (:port CONFIG)
|
||||||
|
;; Dont block REPL thread
|
||||||
|
:join? false}))
|
||||||
|
|
Loading…
Add table
Reference in a new issue