Skip to content

Instantly share code, notes, and snippets.

Created Aug 17, 2014
What would you like to do?
(ns user
(:require [com.stuartsierra.component :as component]
[ :refer (refresh)]
[example-component-ring.component :as app]))
(def system nil)
;; システム初期化
(defn init []
(alter-var-root #'system
(constantly (app/create-system {:port 3000}))))
;; システム起動
(defn start []
(alter-var-root #'system component/start))
;; システム停止
(defn stop []
(alter-var-root #'system
(fn [s] (when s (component/stop s)))))
;; 初期化&起動
(defn go []
;; システムリロード
(defn reset []
(refresh :after 'user/go))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment