## PLT Web Server: Embedding Interface

To use the Web server inside another PLT-Scheme program, require the Web server module:

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

This provides one main function:

> `serve : configuration [nat] [str] -> (-> void)
> (define (serve configuration port ip-address) ...)`

The serve function starts the Web server, just like the launcher does, but the configuration argument supplies the server's settings. The optional port argument overrides the port supplied by the configuration. The optional ip-address restricts accepted web requests to come only from that address.

The result of invoking serve is a function of no arguments that shuts down the server.

Powered by