Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I start Hunchentoot?

How do I start Hunchentoot on a project? I looked over Edi Weitz's guide and everything went smoothly until after installation. The listed tutorials were either broken or skimmed over actual server usage.

I have my asdf file, installed dependencies with quicklisp, and set up a dispatch table. How do I get Hunchentoot to work with this stuff?

like image 693
deadghost Avatar asked Nov 02 '13 06:11

deadghost


1 Answers

To update, I've improved upon Svante's answer:

(defun start-server ()
  (stop-server)
  (start (setf *acceptor*
               (make-instance 'easy-acceptor
                              :port 4242))))

(defun stop-server ()
  (when *acceptor*
    (when started-p *acceptor*
     (stop *acceptor*))))

Prior to starting the server, acceptor is nil. After the server has been started (even if it has subsequently been stopped) it is no longer nil. The started-p test checks to see if an initialized easy-acceptor is started. If you try to stop an already stopped acceptor, you receive an error.

like image 99
JEPrice Avatar answered Oct 04 '22 22:10

JEPrice