From 7840e72e41c180de59f043c8fe26f14e1054a64e Mon Sep 17 00:00:00 2001 From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com> Date: Tue, 8 Aug 2023 16:46:20 -0500 Subject: [PATCH] Allow running in foreground --- kaptchapelo.lisp | 6 ++++-- run-kaptchapelo.lisp | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/kaptchapelo.lisp b/kaptchapelo.lisp index b813466..3a3fd9c 100644 --- a/kaptchapelo.lisp +++ b/kaptchapelo.lisp @@ -100,7 +100,8 @@ make a Clack HTTP response that serves the appropriate image." (404-response))))) -(defun start-server (&key (address "0.0.0.0") (port 5001) (captcha-directory #p"captcha/")) +(defun start-server (&key (address "0.0.0.0") (port 5001) (background 't) + (captcha-directory #p"captcha/")) "Start the Kaptchapelo server, which takes captcha challenges from the given CAPTCHA-DIRECTORY. Challenges are made up of two files: * A challenge PNG file (ex. bird.png) @@ -110,4 +111,5 @@ Note that the The answer text-file should not contain a trailing newline." (lambda (env) (funcall #'server env captcha-directory)) :address address - :port port)) + :port port + :use-thread background)) diff --git a/run-kaptchapelo.lisp b/run-kaptchapelo.lisp index cea6301..a9cd9b9 100755 --- a/run-kaptchapelo.lisp +++ b/run-kaptchapelo.lisp @@ -7,4 +7,5 @@ ;; Change captcha-directory’s path to your captchas :captcha-directory #p"~/.local/lib/quicklisp/local-projects/kaptchapelo/captcha/" :address "0.0.0.0" - :port 5001) + :port 5001 + :background nil)