diff --git a/web/deps.edn b/web/deps.edn index e7c7333..ee61481 100644 --- a/web/deps.edn +++ b/web/deps.edn @@ -1,17 +1,13 @@ {:deps {org.clojure/tools.namespace {:mvn/version "1.0.0"} - org.clojure/tools.deps.alpha - {:git/url "https://github.com/clojure/tools.deps.alpha.git" - :sha "d492e97259c013ba401c5238842cd3445839d020"} digest {:mvn/version "1.4.9"} hiccup {:mvn/version "1.0.5"} com.taoensso/timbre {:mvn/version "5.1.0"} com.taoensso/carmine {:mvn/version "3.0.1"} + com.taoensso/nippy {:mvn/version "3.1.1"} http-kit {:mvn/version "2.5.0"} integrant {:mvn/version "0.8.0"} - integrant/repl {:mvn/version "0.3.2"} seancorfield/next.jdbc {:mvn/version "1.1.610"} - org.xerial/sqlite-jdbc {:mvn/version "3.32.3.2"} honeysql {:mvn/version "1.0.444"} metosin/muuntaja {:mvn/version "0.6.7"} metosin/reitit {:mvn/version "0.5.10"} @@ -27,4 +23,8 @@ :aliases {:dev {:extra-paths ["dev"] :extra-deps {hawk {:mvn/version "0.2.11"} seancorfield/depstar {:mvn/version "1.1.132"} - ring/ring-devel {:mvn/version "1.8.2"}}}}} + ring/ring-devel {:mvn/version "1.8.2"} + integrant/repl {:mvn/version "0.3.2"} + org.clojure/tools.deps.alpha + {:git/url "https://github.com/clojure/tools.deps.alpha.git" + :sha "d492e97259c013ba401c5238842cd3445839d020"}}}}} diff --git a/web/dev/user.clj b/web/dev/user.clj index fea585b..a039206 100644 --- a/web/dev/user.clj +++ b/web/dev/user.clj @@ -15,7 +15,6 @@ [com.darklimericks.db.albums :as db.albums] [com.darklimericks.db.limericks :as db.limericks] [com.darklimericks.server.util :as util] - [com.darklimericks.server.system] [reitit.core :as reitit])) (comment @@ -144,21 +143,4 @@ (-> state/system :app/router) "/limericks/1/1") - (let [router (-> state/system :app/router)] - (util/route-name->path {::reitit/router router} - :com.darklimericks.server.system/artist - {:artist-id 1})) - - (let [router (-> state/system :app/router)] - (util/route-name->path - {::reitit/router router} - :com.darklimericks.server.system/artist - {:artist-id 1})) - - (let [router (-> state/system :app/router)] - (->> :com.darklimericks.server.system/artist - (#(reitit/match-by-name (::reitit/router {::reitit/router router}) - % - {:artist-id 1})) - (reitit/match->path))) ) diff --git a/web/resources/server/config.edn b/web/resources/server/config.edn index db2d5b3..c8efa9f 100644 --- a/web/resources/server/config.edn +++ b/web/resources/server/config.edn @@ -1,5 +1,5 @@ {:com.darklimericks.logging/logging - {:min-level :warning} + {:min-level :warn} :com.darklimericks.server.core/server {:port 80 :handler #ig/ref :com.darklimericks.server.handlers/handler} diff --git a/web/src/com/darklimericks/server/db.clj b/web/src/com/darklimericks/server/db.clj deleted file mode 100644 index 4f03477..0000000 --- a/web/src/com/darklimericks/server/db.clj +++ /dev/null @@ -1,11 +0,0 @@ -(ns com.darklimericks.server.db - (:require [clojure.tools.namespace.repl :as c.t.n.r])) - -(c.t.n.r/disable-reload!) - -(defonce db (atom {})) - -(defonce worker (atom nil)) - -(comment - (reset! worker nil)) diff --git a/web/src/com/darklimericks/server/limericks.clj b/web/src/com/darklimericks/server/limericks.clj index 85c23d7..f293a1c 100644 --- a/web/src/com/darklimericks/server/limericks.clj +++ b/web/src/com/darklimericks/server/limericks.clj @@ -1,20 +1,18 @@ (ns com.darklimericks.server.limericks (:require [clojure.string :as string] + [clojure.java.io :as io] [reitit.core :as reitit] [com.darklimericks.db.artists :as artists] - [com.owoga.prhyme.data-transform :as data-transform] [com.darklimericks.db.albums :as albums] [com.darklimericks.db.limericks :as db.limericks] [com.darklimericks.util.identicon :as identicon] [com.darklimericks.linguistics.core :as linguistics] - [com.owoga.corpus.markov :as markov] - [com.owoga.prhyme.data.dictionary :as dict] - [com.owoga.prhyme.data.darklyrics :refer [darklyrics-markov-2]] + [com.owoga.trie :as trie] [com.owoga.tightly-packed-trie :as tpt] - [clojure.java.io :as io] + [com.owoga.corpus.markov :as markov] + [com.owoga.prhyme.data-transform :as data-transform] [com.owoga.tightly-packed-trie.encoding :as encoding] [taoensso.nippy :as nippy] - [com.owoga.trie :as trie] [taoensso.timbre :as timbre])) (defn parse-scheme-element [[tokens ctx]] @@ -106,8 +104,8 @@ (map string/capitalize) (string/join " "))) -(def database (nippy/thaw-from-file (io/resource "models/database.bin"))) -(def rhyme-trie (into (trie/make-trie) (nippy/thaw-from-file (io/resource "models/rhyme-trie.bin")))) +(def database (nippy/thaw-from-resource "models/database.bin")) +(def rhyme-trie (into (trie/make-trie) (nippy/thaw-from-resource "models/rhyme-trie.bin"))) (def markov-trie (tpt/load-tightly-packed-trie-from-file (io/resource "models/tpt.bin") (markov/decode-fn database))) diff --git a/web/src/com/darklimericks/server/system.clj b/web/src/com/darklimericks/server/system.clj deleted file mode 100644 index 37e8363..0000000 --- a/web/src/com/darklimericks/server/system.clj +++ /dev/null @@ -1,18 +0,0 @@ -(ns com.darklimericks.server.system - (:require [integrant.core :as ig] - [taoensso.timbre :as timbre] - [next.jdbc :as jdbc] - [environ.core :refer [env]] - [taoensso.carmine.message-queue :as car-mq] - [reitit.http :as http] - [reitit.ring :as ring] - [reitit.coercion.spec] - [reitit.interceptor.sieppari :as sieppari] - [reitit.http.interceptors.parameters :refer [parameters-interceptor]] - [com.darklimericks.server.handlers :as handlers] - [com.darklimericks.server.limericks :as limericks] - [com.darklimericks.server.interceptors :as interceptors] - [com.darklimericks.server.db :as db])) - - -