Web Development

Update

The way described here is pretty easy, but an even easier way is to use  Quicklisp. Follow the directions there to install it, and then you can load hunchentoot with (ql:quickload "hunchentoot"). This will fetch, compile, and load hunchentoot and all its dependencies.

Quick Start

Here is a fairly simple way to get started with web development in Common Lisp.

1. Install Clozure CL.

2. Get  Hunchentoot, which is a web server written in Common Lisp, together with its dependencies.

$ cd /usr/local/src
$ svn co http://bknr.net/svn/ediware

3. Create a little lisp file that will configure  ASDF.

;;; ediware.lisp
(require 'asdf)

(defun setup-registry (directory-path)
 (format t "; adding components under ~A to asdf registry~%" directory-path)
 (mapc (lambda (asd-pathname)
         (pushnew (make-pathname :name nil
                                 :type nil
                                 :version nil 
                                 :defaults asd-pathname)
                  asdf:*central-registry*
                 :test #'equal))
       (directory (merge-pathnames #p"*/*.asd" directory-path))))

(setup-registry #p"/usr/local/src/ediware/")

4. Now, start a lisp and evaluate the following:

(load "ediware.lisp")
(asdf:oos 'asdf:load-op :hunchentoot)
(asdf:oos 'asdf:load-op :hunchentoot-test)

5. Start up a web server.

(hunchentoot:start (make-instance 'hunchentoot:acceptor :port 4242))

6. Go to  http://localhost:4242/hunchentoot and it should work. See also  http://localhost:4242/hunchentoot/test

Links to other tutorials