Friday, November 7, 2008

Top-Level Servlets in the PLT Scheme Web Server

A common feature request for the PLT Scheme Web Server is to support servlets that respond to top-level requests. This has been possible in the past with hacks that do URL rewriting and yesterday I talked about how it can be done more effectively with the generalization of the dispatcher (web-server/dispatchers/dispatch-servlets) that interfaces with Scheme servlets.

One of the conveniences provided by the Web Server is web-server/servlet-env, a module that quickly sets up a server tailor for a single servlet. The function it provides serve/servlet accepts an argument to specify the path the servlet should be available from, but it had to end in .ss. I've now removed that restriction and enabled the server to serve other Scheme servlets at the same time.

Now it is incredibly easy to build a PLT Scheme Web Server application that completely controls a URL namespace.

0 comments: