Cover by Conrad Barski M.D.

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Building the Web Server Interface

Now that we’ve completed the graphical side of Dice of Doom version 3, we’re ready to write the side that interfaces with the web server.

Writing Our Web Request Handler

The central function for our web server handling is called dod-request-handler. It is the function that we can pass to the serve command in our web server library, and it is responsible for handling all the web requests coming from the web browser. Here is the code for dod-request-handler:

(defparameter *cur-game-tree* nil)
  (defparameter *from-tile* nil)

  (defun dod-request-handler (path header params)
   (if (equal path "game.html")
 (progn (princ "<!doctype ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required