diff --git a/src/rss_thread_watch/core.clj b/src/rss_thread_watch/core.clj index d42695c..f8e7877 100644 --- a/src/rss_thread_watch/core.clj +++ b/src/rss_thread_watch/core.clj @@ -1,10 +1,29 @@ (ns rss-thread-watch.core - (:gen-class) - (:require )) - + (:require [ring.adapter.jetty :as jetty]) + (: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 "Entry point, starts webserver" [& 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}))