Adding docs and additional option for r12535

svn: r12542
This commit is contained in:
Jay McCarthy 2008-11-20 16:10:31 +00:00
parent 333ec0dfc1
commit 52a561fd3e
2 changed files with 12 additions and 6 deletions

View File

@ -9,6 +9,7 @@
web-server/private/util
web-server/configuration/configuration-table
web-server/configuration/responders
web-server/dispatchers/dispatch-log
scheme/list))
@defmodule[web-server/servlet-env]{
@ -102,6 +103,7 @@ If you want to use @scheme[serve/servlet] in a start up script for a Web server,
[#:servlets-root servlets-root path? (build-path server-root-path "htdocs")]
[#:servlet-current-directory servlet-current-directory path? servlets-root]
[#:file-not-found-responder file-not-found-responder
(request? . -> . response?)
(gen-file-not-found-responder
(build-path
server-root-path
@ -116,7 +118,9 @@ If you want to use @scheme[serve/servlet] in a start up script for a Web server,
(build-path
(directory-part
default-configuration-table-path)
"mime.types")))])
"mime.types")))]
[#:log-file log-file path? #f]
[#:log-format log-format symbol? 'apache-default])
void]{
This sets up and starts a fairly default server instance.
@ -154,6 +158,9 @@ If you want to use @scheme[serve/servlet] in a start up script for a Web server,
running from the command line, in which case the @scheme[command-line?] option controls similar options.
MIME types are looked up at @scheme[mime-types-path].
If @scheme[log-file] is given, then it used to log requests using @scheme[log-format] as the format. Allowable formats
are those allowed by @scheme[log-format->format].
}
}

View File

@ -128,7 +128,9 @@
"mime.types")))]
#:log-file
[log-file #f])
[log-file #f]
#:log-format
[log-format 'apache-default])
(define standalone-url
(string-append (if ssl? "https" "http")
"://localhost"
@ -141,10 +143,7 @@
(define servlet-box (box #f))
(define dispatcher
(dispatcher-sequence
(and log-file (log:make #:format (log:log-format->format
;; 'parenthesized-default
;; 'extended
'apache-default)
(and log-file (log:make #:format (log:log-format->format log-format)
#:log-path log-file))
(and quit? (filter:make #rx"^/quit$" (quit-server sema)))
(filter:make