forked from thephoeron/LLTHW
-
Notifications
You must be signed in to change notification settings - Fork 0
/
llthw.lisp
34 lines (27 loc) · 922 Bytes
/
llthw.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
;;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: LLTHW; Base: 10 -*-
;;;; file: llthw.lisp
;;;; Copyright (c) 2012--2015, "the Phoeron" Colin J.E. Lupton <//thephoeron.com>
;;;; See LICENSE for additional information.
(in-package :llthw)
(defun llthw-start (&key (port 8080))
"Start LLTHW server."
(when (null *acc*)
(setf *acc*
(make-instance 'hunchentoot:easy-acceptor
:port port
:access-log-destination *acc-log*
:message-log-destination *msg-log*)))
(hunchentoot:start *acc*))
(defun llthw-stop ()
"Stop LLTHW server."
(when *acc*
(hunchentoot:stop *acc*))
(setf *acc* nil))
;; Assumes SBCL + Quicklisp
(defun llthw-restart (&key (port 8080))
"Stop, reload/recompile, and start the LLTHW server again."
(llthw-stop)
(ql:quickload "llthw")
(sb-ext:gc :full t)
(llthw-start :port port))
;; EOF