[plt-scheme] How to use SERVE in the web-server?

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Sun Jul 29 10:14:12 EDT 2007


I am updating some code (from December) to the
current version.

I need to use the same web-server configuration
in two places, so I (in the old code) did:

   In "config.ss":
   (require (lib "configuration.ss" "web-server"))
   (define config-sexp <stuff-that-builds-configuration-as-an-sexp>)
   (define config (build-developer-configuration config-sexp)

And then in "launch.ss":

     (require (lib "web-server.ss" "web-server")

     (define shutdown
       (serve config 8888))

Alas, the interface to SERVE has changed (the documentation
did contain a warning, so that's okay), but I can't figure
out to use the new server function.

Instead of a configuration it expects a dispatcher, but
do I turn the configuration into a dispatcher?

Jens Axel Søgaard

Posted on the users mailing list.