Setup mount
This commit is contained in:
parent
735dd4a7ea
commit
3aa2616b39
45
build.boot
45
build.boot
|
@ -1,25 +1,34 @@
|
|||
;; -*- mode: clojure
|
||||
(set-env!
|
||||
:source-paths #{"src/clj" "src/cljc"}
|
||||
:resource-paths #{"resources"}
|
||||
:dependencies '[[org.clojure/clojure "1.10.1"]
|
||||
[org.clojure/spec.alpha "0.2.176"]
|
||||
[org.clojure/core.typed "0.6.0"]
|
||||
[io.pedestal/pedestal.service "0.5.7"]
|
||||
[io.pedestal/pedestal.service-tools "0.5.7"]
|
||||
[io.pedestal/pedestal.immutant "0.5.7"]
|
||||
[io.pedestal/pedestal.jetty "0.5.7"]
|
||||
[manifold "0.1.8"]
|
||||
[tolitius/boot-check "0.1.12"]
|
||||
[cprop "0.1.14"]
|
||||
[metosin/muuntaja "0.6.6"]
|
||||
[com.fasterxml.jackson.core/jackson-databind "2.10.0"]
|
||||
[com.fasterxml.jackson.core/jackson-annotations "2.10.0"]
|
||||
[com.fasterxml.jackson.core/jackson-core "2.10.0"]
|
||||
[metosin/jsonista "0.2.5"]
|
||||
[javax.servlet/servlet-api "2.5"]
|
||||
[com.fasterxml.jackson.core/jackson-databind "2.10.0"]
|
||||
[com.walmartlabs/lacinia "0.36.0-alpha-2"]
|
||||
[com.walmartlabs/lacinia "0.36.0-alpha-2"]
|
||||
[com.walmartlabs/lacinia-pedestal "0.13.0-alpha-1"]
|
||||
[com.walmartlabs/lacinia-pedestal "0.13.0-alpha-1"]
|
||||
[cprop "0.1.14"]
|
||||
[deraen/boot-sass "0.5.0"]
|
||||
[domino/core "0.3.0"]
|
||||
[samestep/boot-refresh "0.1.0" :scope "test"]
|
||||
[clojurewerkz/neocons "3.2.0"]
|
||||
[io.pedestal/pedestal.immutant "0.5.7"]
|
||||
[io.pedestal/pedestal.jetty "0.5.7"]
|
||||
[io.pedestal/pedestal.service "0.5.7"]
|
||||
[io.pedestal/pedestal.service-tools "0.5.7"]
|
||||
[javax.servlet/servlet-api "2.5"]
|
||||
[manifold "0.1.8"]
|
||||
[metosin/jsonista "0.2.5"]
|
||||
[logback-bundle/core-bundle "0.3.0"]
|
||||
[metosin/muuntaja "0.6.6"]
|
||||
[metosin/reitit "0.3.10"]
|
||||
[mount "0.1.16"]
|
||||
[org.clojure/core.typed "0.6.0"]
|
||||
[org.clojure/spec.alpha "0.2.176"]
|
||||
[samestep/boot-refresh "0.1.0" :scope "test"]
|
||||
[tolitius/boot-check "0.1.12"]
|
||||
[metosin/reitit-pedestal "0.3.10"]])
|
||||
|
||||
(def version "0.1.0-SNAPSHOT")
|
||||
|
@ -44,13 +53,19 @@
|
|||
|
||||
;; -- My Tasks --------------------------------------------
|
||||
(deftask check-sources []
|
||||
(set-env! :source-paths #{"src/clj" "src/cljc" "test"}
|
||||
(set-env! :source-paths #{"src/clj" "src/cljc"}
|
||||
(comp
|
||||
(check/with-yagni)
|
||||
(check/with-eastwood)
|
||||
(check/with-kibit)
|
||||
(check/with-bikeshed))))
|
||||
|
||||
(deftask dev []
|
||||
(set-env!
|
||||
:dependencies '[])
|
||||
(check-sources)
|
||||
(watch)
|
||||
(refresh))
|
||||
|
||||
(deftask build
|
||||
"Build an uberjar of the project."
|
||||
|
|
|
@ -1,24 +1,25 @@
|
|||
(ns redblackrose.core
|
||||
(:gen-class)
|
||||
(:require [io.pedestal.http :as server]
|
||||
[reitit.ring :as ring]
|
||||
[reitit.http :as http]
|
||||
[reitit.coercion.spec]
|
||||
[reitit.swagger :as swagger]
|
||||
[reitit.swagger-ui :as swagger-ui]
|
||||
[reitit.http.coercion :as coercion]
|
||||
[reitit.dev.pretty :as pretty]
|
||||
[reitit.http.interceptors.parameters :as parameters]
|
||||
[reitit.http.interceptors.muuntaja :as muuntaja]
|
||||
[reitit.http.interceptors.exception :as exception]
|
||||
[reitit.http.interceptors.multipart :as multipart]
|
||||
[reitit.http.interceptors.dev :as dev]
|
||||
[reitit.http.spec :as spec]
|
||||
[spec-tools.spell :as spell]
|
||||
[io.pedestal.http :as server]
|
||||
[reitit.pedestal :as pedestal]
|
||||
[clojure.core.async :as a]
|
||||
[clojure.java.io :as io]
|
||||
[mount.core :as mount]
|
||||
[reitit.coercion.spec]
|
||||
[reitit.dev.pretty :as pretty]
|
||||
[reitit.http :as http]
|
||||
[reitit.http.coercion :as coercion]
|
||||
[reitit.http.interceptors.dev :as dev]
|
||||
[reitit.http.interceptors.exception :as exception]
|
||||
[reitit.http.interceptors.multipart :as multipart]
|
||||
[reitit.http.interceptors.muuntaja :as muuntaja]
|
||||
[reitit.http.interceptors.parameters :as parameters]
|
||||
[reitit.http.spec :as spec]
|
||||
[reitit.pedestal :as pedestal]
|
||||
[reitit.ring :as ring]
|
||||
[reitit.swagger :as swagger]
|
||||
[reitit.swagger-ui :as swagger-ui]
|
||||
[spec-tools.spell :as spell]
|
||||
[redblackrose.db]
|
||||
[muuntaja.core :as m]))
|
||||
|
||||
(defn interceptor [number]
|
||||
|
@ -116,10 +117,10 @@
|
|||
(ring/create-resource-handler)
|
||||
(ring/create-default-handler))))
|
||||
|
||||
(defn start []
|
||||
(defn start [port]
|
||||
(-> {:env :dev
|
||||
::server/type :jetty
|
||||
::server/port 3000
|
||||
::server/port port
|
||||
::server/join? false
|
||||
;; no pedestal routes
|
||||
::server/routes []
|
||||
|
@ -134,10 +135,22 @@
|
|||
(server/dev-interceptors)
|
||||
(server/create-server)
|
||||
(server/start))
|
||||
(println "server running in port 3000"))
|
||||
(println (str "server running in port " port)))
|
||||
|
||||
(comment
|
||||
(start))
|
||||
|
||||
;; ;; (def config
|
||||
;; ;; {:adapter/jetty {:port 3000}})
|
||||
|
||||
;; ;; (defmethod ig/init-key :adapter/jetty [_ {:keys [] :as opts}]
|
||||
;; ;; (start [opts]))
|
||||
|
||||
;; ;; (def system
|
||||
;; ;; (ig/init config))
|
||||
|
||||
;; (defn -main [& args]
|
||||
;; (system))
|
||||
|
||||
(mount/defstate conn :start (start 3000))
|
||||
|
||||
(defn -main [& args]
|
||||
(start))
|
||||
(mount/start))
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
(ns redblackrose.db
|
||||
(:require
|
||||
[cprop.core :refer [load-config]]
|
||||
[clojurewerkz.neocons.rest :as nr]
|
||||
[mount.core :as mount]))
|
||||
|
||||
(def conf (load-config :resource "config.edn"))
|
||||
|
||||
|
||||
;; (mount/defstate db-conn :start (nr/connect (conf :url)))
|
|
@ -1,7 +0,0 @@
|
|||
(ns redblackrose.core-test
|
||||
(:require [clojure.test :refer :all]
|
||||
[redblackrose.core :refer :all]))
|
||||
|
||||
(deftest a-test
|
||||
(testing "FIXME, I fail."
|
||||
(is (= 0 1))))
|
Loading…
Reference in New Issue