Browse Source

Code cleanup and formatting

master
Stephen Starkey 2 years ago
parent
commit
7ebabee450
  1. 6
      src/clj/email_counter/core.clj
  2. 3
      src/clj/email_counter/emails.clj
  3. 6
      src/clj/email_counter/handler.clj
  4. 4
      src/clj/email_counter/middleware.clj
  5. 1
      src/clj/email_counter/middleware/formats.clj

6
src/clj/email_counter/core.clj

@ -1,11 +1,11 @@
(ns email-counter.core
(:require
[clojure.tools.cli :refer [parse-opts]]
[clojure.tools.logging :as log]
[email-counter.handler :as handler]
[email-counter.nrepl :as nrepl]
[luminus.http-server :as http]
[email-counter.config :refer [env]]
[clojure.tools.cli :refer [parse-opts]]
[clojure.tools.logging :as log]
[luminus.http-server :as http]
[mount.core :as mount])
(:gen-class))

3
src/clj/email_counter/emails.clj

@ -1,6 +1,5 @@
(ns email-counter.emails
(:require [clojure.string :as str]
[clojure.tools.logging :as log])
(:require [clojure.string :as str])
(:import (javax.mail.internet AddressException InternetAddress)))
(defn parse-email

6
src/clj/email_counter/handler.clj

@ -10,14 +10,16 @@
(mount/defstate init-app
:start ((or (:init defaults) (fn [])))
:stop ((or (:stop defaults) (fn []))))
:stop ((or (:stop defaults) (fn []))))
(mount/defstate app-routes
:start
(ring/ring-handler
(ring/router
[["/" {:get
{:handler (constantly {:status 301 :headers {"Location" "/api/api-docs/index.html"}})}}]
{:handler (constantly
{:status 301
:headers {"Location" "/api/api-docs/index.html"}})}}]
(service-routes)])
(ring/routes
(ring/create-resource-handler

4
src/clj/email_counter/middleware.clj

@ -1,7 +1,7 @@
(ns email-counter.middleware
(:require
[email-counter.env :refer [defaults]]
[email-counter.config :refer [env]]
[email-counter.env :refer [defaults]]
[ring-ttl-session.core :refer [ttl-memory-store]]
[ring.middleware.defaults :refer [site-defaults wrap-defaults]]))
@ -10,4 +10,4 @@
(wrap-defaults
(-> site-defaults
(assoc-in [:security :anti-forgery] false)
(assoc-in [:session :store] (ttl-memory-store (* 60 30)))))))
(assoc-in [:session :store] (ttl-memory-store (* 60 30)))))))

1
src/clj/email_counter/middleware/formats.clj

@ -1,6 +1,5 @@
(ns email-counter.middleware.formats
(:require
[cognitect.transit :as transit]
[luminus-transit.time :as time]
[muuntaja.core :as m]))

Loading…
Cancel
Save