From d5eded5a67febc962016f08b5f26905be1b7f35e Mon Sep 17 00:00:00 2001 From: Felisp Date: Thu, 21 Dec 2023 03:00:12 +0100 Subject: [PATCH] Prepare for development --- src/rss_thread_watch/core.clj | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) 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}))