website/src/main.lisp

33 lines
778 B
Common Lisp
Raw Normal View History

2025-05-02 09:39:55 +09:00
(defpackage #:website
(:nicknames #:website/main)
2024-10-05 22:05:26 +09:00
(:use #:cl)
2025-03-29 01:07:45 +09:00
(:import-from #:clack)
2025-05-02 09:39:55 +09:00
(:import-from #:website/app
2024-10-05 22:05:26 +09:00
#:*app*)
(:export #:start
#:stop
2024-11-16 20:37:45 +09:00
#:reload))
2025-05-02 09:39:55 +09:00
(in-package #:website)
2024-10-05 22:05:26 +09:00
2025-03-29 01:07:45 +09:00
(defparameter *handler* nil)
2024-10-05 22:05:26 +09:00
(defun start ()
2025-03-29 01:07:45 +09:00
(if *handler*
(format t "The server is already running.~%")
(setf *handler* (clack:clackup *app*
:server :hunchentoot
:address "localhost"
:port 3000))))
2024-10-05 22:05:26 +09:00
(defun stop ()
2025-03-29 01:07:45 +09:00
(if *handler*
(progn
(clack:stop *handler*)
(setf *handler* nil))
(format t "The server is not running.~%")))
2024-10-05 22:05:26 +09:00
2024-11-16 20:37:45 +09:00
(defun reload ()
2024-10-05 22:05:26 +09:00
(stop)
2025-05-02 09:39:55 +09:00
(ql:quickload :website/app)
2024-10-05 22:05:26 +09:00
(start))