feat: add spine-skip-server-start guard for testing

This commit is contained in:
2026-06-20 16:56:46 -04:00
parent 362a83ca42
commit a93efd3617
+10 -5
View File
@@ -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 ------------------------------------------------------------
(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)
(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))
(provide 'spine)
;;; spine.el ends here