On this page:
6.1 Configuration Signature
web-config^
max-waiting
virtual-hosts
scripts
initial-connection-timeout
port
listen-ip
make-servlet-namespace
6.2 Configuration Units
configuration-table->web-config@
configuration-table-sexpr->web-config@
Version: 4.1

6 Web Config Unit

The Web Server offers a unit-based approach to configuring the server.

6.1 Configuration Signature

 (require web-server/web-config-sig)

web-config^ : signature

Provides contains the following identifiers.

max-waiting : integer?

Passed to tcp-accept.

virtual-hosts : (listof (cons/c string? host-table?))

Contains the configuration of individual virtual hosts.

scripts : (box/c (cache-table? path? servlet?))

Contains initially loaded servlets.

initial-connection-timeout : integer?

Specifies the initial timeout given to a connection.

port : port-number?

Specifies the port to serve HTTP on.

listen-ip : string?

Passed to tcp-accept.

make-servlet-namespace : make-servlet-namespace?

Passed to servlets:make.

6.2 Configuration Units

 (require web-server/web-config-unit)

(configuration-table->web-config@

 

 

 

path

 

 

 [

#:port port

 

 

 

#:listen-ip listen-ip

 

 

 

#:make-servlet-namespace make-servlet-namespace])

 

  (unit? web-config^)

  path : path?

  port : (or/c false/c port-number?) = #f

  listen-ip : (or/c false/c string?) = #f

  

make-servlet-namespace

 

:

 

make-servlet-namespace?

 

 

 

=

 

(make-make-servlet-namespace)

Reads the S-expression at path and calls configuration-table-sexpr->web-config@ appropriately.

(configuration-table-sexpr->web-config@

 

 

 

sexpr

 

 

 [

#:web-server-root web-server-root

 

 

 

#:port port

 

 

 

#:listen-ip listen-ip

 

 

 

#:make-servlet-namespace make-servlet-namespace])

 

  (unit? web-config^)

  sexpr : list?

  

web-server-root

 

:

 

path?

 

 

 

=

 

(directory-part default-configuration-table-path)

  port : (or/c false/c port-number?) = #f

  listen-ip : (or/c false/c string?) = #f

  

make-servlet-namespace

 

:

 

make-servlet-namespace?

 

 

 

=

 

(make-make-servlet-namespace)

Parses sexpr as a configuration-table and constructs a web-config^ unit.