A blogging website with a focus on collecting recipes and searching for them based on their ingredients.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

30 lines
744 B

(in-package :cl-user)
(defpackage larder.web
(:use :cl)
(:import-from :larder.web.config
:config)
(:import-from :clack
:clackup)
(:export :start
:stop))
(in-package :larder.web)
(defvar *appfile-path*
(asdf:system-relative-pathname :larder.web #P"app.lisp"))
(defvar *handler* nil)
(defun start (&rest args &key server port debug &allow-other-keys)
(declare (ignore server port debug))
(when *handler*
(restart-case (error "Server is already running.")
(restart-server ()
:report "Restart the server"
(stop))))
(setf *handler*
(apply #'clackup *appfile-path* args)))
(defun stop ()
(prog1
(clack:stop *handler*)
(setf *handler* nil)))