summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2017-12-21T13·00+0100
committerVincent Ambo <tazjin@gmail.com>2017-12-21T13·00+0100
commit02a34a14a007cd3f03203173de8de1ab5507d6fb (patch)
tree02cf30fdb5e15f5bcdb21a07f35173a50efa00f9
parentbf9991026a70a7ffe87193a4ca2cbb98e443dd84 (diff)
feat(lisp): Make server port configurable
-rw-r--r--src/gemma.lisp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gemma.lisp b/src/gemma.lisp
index 279cbb3cceaa..008e2841b82f 100644
--- a/src/gemma.lisp
+++ b/src/gemma.lisp
@@ -44,6 +44,10 @@
             :initarg :done-at
             :accessor last-done-at)))
 
+(defvar *gemma-port*
+  (parse-integer (or (sb-posix:getenv "GEMMA_PORT") "4242"))
+  "Port on which the Gemma web server should listen.")
+
 (defvar *gemma-data-dir*
   (pathname (or (sb-posix:getenv "GEMMA_DATA_DIR")
                 (sb-posix:getcwd)))
@@ -107,7 +111,7 @@ maximum interval."
 
 (defun start-gemma ()
   ;; Set up web server
-  (hunchentoot:start (make-instance 'hunchentoot:easy-acceptor :port 4242))
+  (hunchentoot:start (make-instance 'hunchentoot:easy-acceptor :port *gemma-port*))
 
   ;; ... and register all handlers.