Skip to content

Commit

Permalink
feat: uberjar build
Browse files Browse the repository at this point in the history
  • Loading branch information
TimoKramer committed Mar 24, 2022
1 parent 26b932f commit 1cd1a29
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.clj-kondo/
.cpcache/
target/
.nrepl-port
34 changes: 21 additions & 13 deletions src/souffleuse/core.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(ns souffleuse.core
(:gen-class)
(:require [souffleuse.scheduler :as s]
[org.httpkit.server :as srv]
[org.httpkit.client :as clnt]
Expand All @@ -19,15 +20,14 @@
(def slack-hook-url (System/getenv "SLACK_HOOK_URL"))
(def slack-channel "#datahike")

(def twitter-api-key (System/getenv "API_KEY"))
(def twitter-api-secret (System/getenv "API_SECRET"))
(def twitter-access-token (System/getenv "ACCESS_TOKEN"))
(def twitter-access-token-secret (System/getenv "ACCESS_TOKEN_SECRET"))
(def twitter-creds (oauth/make-oauth-creds
twitter-api-key
twitter-api-secret
twitter-access-token
twitter-access-token-secret))
(def twitter-api-key (System/getenv "TWITTER_API_KEY"))
(def twitter-api-secret (System/getenv "TWITTER_API_SECRET"))
(def twitter-access-token (System/getenv "TWITTER_ACCESS_TOKEN"))
(def twitter-access-token-secret (System/getenv "TWITTER_ACCESS_TOKEN_SECRET"))
(def twitter-creds (oauth/make-oauth-creds twitter-api-key
twitter-api-secret
twitter-access-token
twitter-access-token-secret))

(defn log-request [d]
(log/info "Received webhook" d)
Expand Down Expand Up @@ -124,11 +124,19 @@
;; Server
;;;;;;;;;;;;;;;;;;;;;;;;;;

(def server (let [url (str "http://localhost:" port "/")]
(println "serving" url)
(srv/run-server #'routes {:port port})))
(defn server []
(let [url (str "http://localhost:" port "/")]
(log/info "Server started" {:url url
:port port})
(srv/run-server #'routes {:port port})))

(def scheduler (s/start-scheduler trigger-slack-reminder))
(defn scheduler []
(log/info "Scheduler started")
(s/start-scheduler trigger-slack-reminder))

(defn -main [& args]
(server)
(scheduler))

(comment
(def payload (json/parse-string (slurp "test/payload.sample.json") true))
Expand Down

0 comments on commit 1cd1a29

Please sign in to comment.