mirror of
https://github.com/journeyman-cc/smeagol.git
synced 2026-04-12 18:05:06 +00:00
REPL now working; Tomcat per-instance configuration still not.
This commit is contained in:
parent
f46af642a4
commit
9ca1cc05ab
3 changed files with 40 additions and 29 deletions
|
|
@ -35,7 +35,10 @@
|
|||
[prismatic/schema "1.1.9"]
|
||||
[prone "1.1.4"]
|
||||
[ring/ring-anti-forgery "1.1.0"]
|
||||
[ring-server "0.4.0"]
|
||||
[ring/ring-core "1.9.1"]
|
||||
[ring/ring-defaults "0.3.2"]
|
||||
[ring-server "0.5.0"]
|
||||
[ring-webjars "0.2.0"]
|
||||
[selmer "1.11.0"]]
|
||||
|
||||
:repl-options {:init-ns smeagol.repl}
|
||||
|
|
|
|||
|
|
@ -62,10 +62,11 @@
|
|||
be used as for environment variables, because it just makes life easier."
|
||||
[vars]
|
||||
(log/info "Seeking config in initial context")
|
||||
(log/debug (str "Bound names are: " (map #(.toString %) (.list (new javax.naming.InitialContext) "java:comp/env/"))))
|
||||
(try
|
||||
(reduce
|
||||
#(try
|
||||
(log/info "Seeking value for " %2 " in initial context")
|
||||
(log/debug "Seeking value for " %2 " in initial context")
|
||||
(let [v (javax.naming.InitialContext/doLookup %2)]
|
||||
(if v
|
||||
(do
|
||||
|
|
@ -73,10 +74,12 @@
|
|||
(assoc %1 %2 v))
|
||||
%1))
|
||||
(catch Exception e
|
||||
(log/warn (str "Error while seeking value for " %2 " in initial context: " (type e) "; " (.getMessage e)))
|
||||
(log/debug (str "Error while seeking value for " %2 " in initial context: " (type e) "; " (.getMessage e)))
|
||||
%1))
|
||||
{}
|
||||
(map #(str "java:comp/env/" (name %)) vars))
|
||||
(map #(str
|
||||
"java:comp/env/"
|
||||
(s/replace (name %) #"-" "_")) vars))
|
||||
(catch javax.naming.NoInitialContextException _
|
||||
;; ignore: this only means we're not in a servlet context,
|
||||
;; e.g unit tests.
|
||||
|
|
|
|||
|
|
@ -4,31 +4,33 @@
|
|||
(:require
|
||||
[ring.middleware.file :refer [wrap-file]]
|
||||
[ring.middleware.file-info :refer [wrap-file-info]]
|
||||
[ring.server.standalone :refer [app serve]]
|
||||
[smeagol.handler :refer [destroy init]]))
|
||||
[ring.server.standalone :refer [serve]]
|
||||
[smeagol.handler :refer [app destroy init]])
|
||||
;; (:import [javax.servlet AsyncContext])
|
||||
)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;
|
||||
;;;; Smeagol: a very simple Wiki engine.
|
||||
;;;;
|
||||
;;;; This program is free software; you can redistribute it and/or
|
||||
;;;; modify it under the terms of the GNU General Public License
|
||||
;;;; as published by the Free Software Foundation; either version 2
|
||||
;;;; of the License, or (at your option) any later version.
|
||||
;;;;
|
||||
;;;; This program is distributed in the hope that it will be useful,
|
||||
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;;;; GNU General Public License for more details.
|
||||
;;;;
|
||||
;;;; You should have received a copy of the GNU General Public License
|
||||
;;;; along with this program; if not, write to the Free Software
|
||||
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
;;;; USA.
|
||||
;;;;
|
||||
;;;; Copyright (C) 2014 Simon Brooke
|
||||
;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;;;
|
||||
;; ;;;; Smeagol: a very simple Wiki engine.
|
||||
;; ;;;;
|
||||
;; ;;;; This program is free software; you can redistribute it and/or
|
||||
;; ;;;; modify it under the terms of the GNU General Public License
|
||||
;; ;;;; as published by the Free Software Foundation; either version 2
|
||||
;; ;;;; of the License, or (at your option) any later version.
|
||||
;; ;;;;
|
||||
;; ;;;; This program is distributed in the hope that it will be useful,
|
||||
;; ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; ;;;; GNU General Public License for more details.
|
||||
;; ;;;;
|
||||
;; ;;;; You should have received a copy of the GNU General Public License
|
||||
;; ;;;; along with this program; if not, write to the Free Software
|
||||
;; ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
;; ;;;; USA.
|
||||
;; ;;;;
|
||||
;; ;;;; Copyright (C) 2014 Simon Brooke
|
||||
;; ;;;;
|
||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
||||
(defonce server (atom nil))
|
||||
|
|
@ -47,7 +49,7 @@
|
|||
(defn start-server
|
||||
"used for starting the server in development mode from REPL"
|
||||
[& [port]]
|
||||
(let [port (if port (Integer/parseInt port) 3000)]
|
||||
(let [port (if port (Integer/parseInt (str port)) 3000)]
|
||||
(reset! server
|
||||
(serve (get-handler)
|
||||
{:port port
|
||||
|
|
@ -60,3 +62,6 @@
|
|||
(defn stop-server []
|
||||
(.stop @server)
|
||||
(reset! server nil))
|
||||
|
||||
;; ;;(start-server 4444)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue