[racket] passing a list of dispatch clauses to dispatch-rules

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Tue Dec 17 09:45:59 EST 2013

The first one is what I would write, except that I'd put it after the
["" ...] case so it doesn't shadow it.

How are you testing this code? (next-dispatcher) is supposed to throw
an exception, but it will caught and used by the Web server when you
are using serve/servlet, etc.


On Tue, Dec 17, 2013 at 7:11 AM, Janos Tobias Locsei
<jtlocsei at cantab.net> wrote:
> I thought I'd add a note about what my overall objective with this is, in
> case there's a completely different way of achieving the same thing.
> Basically what I want is to be able to serve a combination of apps and
> static html pages on my domain, but I don't want ".html" as the end of the
> url for the static pages. So, if someone goes to the url
> http://mysite.com/lolcats
> ...then I'd like the web server will look in the directory
> /htdocs/static-html/ and check whether there's a file called lolcats.html,
> and serve that page if it's there.
> My idea was that to achieve this I'd write a dispatch function that would
> check the static-html directory for a file with the correct name, and serve
> that page using the "include-template" function in web-server/templates.
> But if there's an easier/better way of achieving the same thing then I'm
> open to that.
> Tobias

Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University

"The glory of God is Intelligence" - D&C 93

Posted on the users mailing list.