clean up logging and hook up run fns to api proc handlers
This commit is contained in:
parent
a480f98cca
commit
ef4f8959df
6 changed files with 21 additions and 174 deletions
|
|
@ -1,15 +1,25 @@
|
|||
(ns micro-blog.api
|
||||
(:require [io.pedestal.connector :as conn]
|
||||
[io.pedestal.http.http-kit :as hk]
|
||||
[io.pedestal.log :as log]))
|
||||
micro-blog.mastodon
|
||||
micro-blog.blue-sky
|
||||
[taoensso.telemere :as tel]))
|
||||
|
||||
(defn greet-handler [request]
|
||||
;; (log/info :in 'greet-handler :method (:request-method request) :uri (:uri request))
|
||||
(defn mastodon-proc-handler []
|
||||
(tel/log! :info "Procing Mastodon Scrape")
|
||||
(micro-blog.mastodon/run)
|
||||
{:status 200
|
||||
:body "Hello, world!\n"})
|
||||
:body "Scraped Mastodon\n"})
|
||||
|
||||
(defn blue-sky-proc-handler []
|
||||
(tel/log! :info "Procing BlueSky Scrape")
|
||||
(micro-blog.mastodon/run)
|
||||
{:status 200
|
||||
:body "Scraped Mastodon\n"})
|
||||
|
||||
(def routes
|
||||
#{["/greet" :get greet-handler :route-name :greet]})
|
||||
#{["/bluesky" :get blue-sky-proc-handler :route-name :blue-sky]
|
||||
["/mastodon" :get mastodon-proc-handler :route-name :mastodon]})
|
||||
|
||||
(defn create-connector []
|
||||
(-> (conn/default-connector-map 8890)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue