server.lisp 659 Bytes
Newer Older
Ioanna M. Dimitriou H.'s avatar
Ioanna M. Dimitriou H. committed
1 2 3 4 5 6 7
(in-package :ioa.re)

;; Server and initial dispatch table

(defvar *server*)

(setq hunchentoot:*dispatch-table*  ; dispatches folders, files, and pages
8
      (ioa.re.dispatchers:get-dispatch-table))
Ioanna M. Dimitriou H.'s avatar
Ioanna M. Dimitriou H. committed
9 10 11 12 13 14 15 16 17 18 19 20 21

(defun start-website (&key (address "localhost") (port 8383))
  (setq *server* (hunchentoot:start
		  (make-instance 'easy-acceptor
				 :address address
				 :port port))))

(defun stop-website ()
  (stop *server*))

;;; debugging

(defun debug-mode-on ()
22 23
  (setq hunchentoot:*catch-errors-p* NIL)
  (setq hunchentoot:*show-lisp-errors-p* T))
Ioanna M. Dimitriou H.'s avatar
Ioanna M. Dimitriou H. committed
24 25

(defun debug-mode-off ()
26 27
  (setq hunchentoot:*catch-errors-p* T)
  (setq hunchentoot:*show-lisp-errors-p* NIL))