From: Carlo
Subject: Dispatch by host name with hunchentoot
Date: 
Message-ID: <a1ee9b23-7096-4e4e-bb1d-1308446da813@y29g2000hsf.googlegroups.com>
What is the simplest way to define handlers depending on the host name
of the request?

Carlo

From: Leslie P. Polzer
Subject: Re: Dispatch by host name with hunchentoot
Date: 
Message-ID: <49057e89$0$17068$6e1ede2f@read.cnntp.org>
On Sat, 25 Oct 2008 12:15:31 -0700, Carlo wrote:

> What is the simplest way to define handlers depending on the host name
> of the request?
> 
> Carlo

(push (lambda (req)
        (when (equalp (host req) "foo:4242")
          (lambda () "hello!")))
      *dispatch-table*)

This assumes that your server is running on port 4242, of course.
To check only the host name, use SPLIT-SEQUENCE or CL-PPCRE to
split at the colon.

  Leslie
From: Carlo
Subject: Re: Dispatch by host name with hunchentoot
Date: 
Message-ID: <70714ed6-6568-4a92-8883-5cd32bfeeda0@t41g2000hsc.googlegroups.com>
Thank you, Leslie!

Carlo