about summary refs log tree commit diff
path: root/fun
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-01-22T11·56+0000
committerVincent Ambo <tazjin@google.com>2020-01-22T11·56+0000
commit6fdc5b562d9a6e708dd179679faab429f13c563e (patch)
tree6406ece0b9b51ea26b55a2a3f7bf5b62592ce1b9 /fun
parenta1d624057cf7e184aca3c19c83b3f2815c1883b8 (diff)
refactor(fun/gemma): Make acceptor available in a variable r/445
This makes it possible to *stop* the server again in a REPL, which is
useful :)
Diffstat (limited to 'fun')
-rw-r--r--fun/gemma/src/gemma.lisp11
1 files changed, 7 insertions, 4 deletions
diff --git a/fun/gemma/src/gemma.lisp b/fun/gemma/src/gemma.lisp
index cf074cfb87..20a76caae6 100644
--- a/fun/gemma/src/gemma.lisp
+++ b/fun/gemma/src/gemma.lisp
@@ -29,6 +29,9 @@
 (defvar *gemma-port* 4242
   "Port on which the Gemma web server listens.")
 
+(defvar *gemma-acceptor* nil
+  "Hunchentoot acceptor for Gemma's web server.")
+
 (defvar *static-file-location* "frontend/"
   "Folder from which to serve static assets. If built inside of Nix,
   the path is injected during the build.")
@@ -134,10 +137,10 @@ maximum interval."
                       "/etc/gemma/config.lisp")))
 
   ;; Set up web server
-  (hunchentoot:start
-   (make-instance 'hunchentoot:easy-acceptor
-                  :port *gemma-port*
-                  :document-root *static-file-location*))
+  (setq *gemma-acceptor* (make-instance 'hunchentoot:easy-acceptor
+                                        :port *gemma-port*
+                                        :document-root *static-file-location*))
+  (hunchentoot:start *gemma-acceptor*)
 
   ;; Task listing handler
   (hunchentoot:define-easy-handler