feat: add spine-skip-server-start guard for testing
This commit is contained in:
@@ -43,6 +43,10 @@ Returns the rendered string."
|
||||
(buffer-string))
|
||||
context))
|
||||
|
||||
(defvar spine-skip-server-start nil
|
||||
"When non-nil, do not start the HTTP server.
|
||||
Set by test harnesses that only need the model functions.")
|
||||
|
||||
;; --- handlers ---------------------------------------------------------
|
||||
|
||||
(defservlet hello text/html ()
|
||||
@@ -51,11 +55,12 @@ Returns the rendered string."
|
||||
("message" "Hello from Emacs.")))))
|
||||
|
||||
;; --- start ------------------------------------------------------------
|
||||
(unless spine-skip-server-start
|
||||
(setq httpd-host spine-host)
|
||||
(setq httpd-port spine-port)
|
||||
(httpd-start)
|
||||
(message "Spine listening on http://%s:%d"
|
||||
(or spine-host "localhost") spine-port)
|
||||
(or spine-host "localhost") spine-port))
|
||||
|
||||
(provide 'spine)
|
||||
;;; spine.el ends here
|
||||
|
||||
Reference in New Issue
Block a user