racket/collects/web-server/docs/reference/web-config-unit.scrbl
Jay McCarthy 9341654f05 Sensifying location of defs
svn: r6632
2007-06-13 16:53:09 +00:00

59 lines
2.2 KiB
Racket

#reader(lib "docreader.ss" "scribble")
@require["../web-server.ss"]
@title[#:tag "web-config-unit.ss"
#:style 'toc]{Web Config Unit}
The @web-server offers a unit-based approach to configuring the server.
@file{web-config-sig.ss} provides the signature
@defthing[web-config^ signature?] signature, which contains the following
identifiers:
@defthing[max-waiting integer?]{
Passed to @scheme[tcp-accept].
}
@defthing[virtual-hosts (listof (cons/c string? host-table?))]{
Contains the configuration of individual virtual hosts.
}
@defthing[scripts (box/c (cache-table? path? servlet?))]{
Contains initially loaded servlets.
}
@defthing[initial-connection-timeout integer?]{
Specifies the initial timeout given to a connection.
}
@defthing[port port-number?]{
Specifies the port to serve HTTP on.
}
@defthing[listen-ip string?]{
Passed to @scheme[tcp-accept].
}
@defthing[make-servlet-namespace make-servlet-namespace?]{
Passed to @scheme[servlets:make].
}
@file{web-config-unit.ss} provides the following:
@defproc[(configuration-table->web-config\@ [path path?]
[#:port port (or/c false/c port-number?) #f]
[#:listen-ip listen-ip (or/c false/c string?) #f]
[#:make-servlet-namespace make-servlet-namespace make-servlet-namespace? (make-make-servlet-namespace)])
(unit? web-config^)]{
Reads the S-expression at @scheme[path] and calls @scheme[configuration-table-sexpr->web-config\@] appropriately.
}
@defproc[(configuration-table-sexpr->web-config\@ [sexpr list?]
[#:web-server-root web-server-root path? (directory-part default-configuration-table-path)]
[#:port port (or/c false/c port-number?) #f]
[#:listen-ip listen-ip (or/c false/c string?) #f]
[#:make-servlet-namespace make-servlet-namespace make-servlet-namespace? (make-make-servlet-namespace)])
(unit? web-config^)]{
Parses @scheme[sexpr] as a configuration-table and constructs a @scheme[web-config^] unit.
}