website/src/main.lisp

33 lines
753 B
Common Lisp
Raw Normal View History

2024-10-05 22:05:26 +09:00
(defpackage #:hp
(:nicknames #:hp/main)
(:use #:cl)
2025-03-29 01:07:45 +09:00
(:import-from #:clack)
2024-10-05 22:05:26 +09:00
(:import-from #:hp/app
#:*app*)
(:export #:start
#:stop
2024-11-16 20:37:45 +09:00
#:reload))
2024-10-05 22:05:26 +09:00
(in-package #:hp)
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)
(ql:quickload :hp/app)
(start))