From 6fdc5b562d9a6e708dd179679faab429f13c563e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 22 Jan 2020 11:56:13 +0000 Subject: refactor(fun/gemma): Make acceptor available in a variable This makes it possible to *stop* the server again in a REPL, which is useful :) --- fun/gemma/src/gemma.lisp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'fun') 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 -- cgit 1.4.1