(require (lib "web-server.ss" "web-server")
         (lib "web-config-unit.ss" "web-server")
         (lib "config.ss" "planet")
         (lib "etc.ss")
         "servlets/config.scm")
(define config-sexp
  `((port ,port)
    (max-waiting 40)
    (initial-connection-timeout 30)
    (default-host-table
      (host-table
       (default-indices "index.html" "index.htm")
       (log-format parenthesized-default)
       (messages
        (servlet-message "servlet-error.html")
        (authentication-message "forbidden.html")
        (servlets-refreshed "servlet-refresh.html")
        (passwords-refreshed "passwords-refresh.html")
        (file-not-found-message "not-found.html")
        (protocol-message "protocol-error.html")
        (collect-garbage "collect-garbage.html"))
       (timeouts
        (default-servlet-timeout 30)
        (password-connection-timeout 300)
        (servlet-connection-timeout 86400)
        (file-per-byte-connection-timeout 1/20)
        (file-base-connection-timeout 30))
       (paths
        (configuration-root "conf")
        (host-root     ,(this-expression-source-directory))
        (file-root     "htdocs")
        (servlet-root  ".")
        (mime-types "mime.types")
        (password-authentication "passwords"))))
    (virtual-host-table)))
(define shutdown 
  (serve/web-config@ (configuration-table-sexpr->web-config@ config-sexp)))
(display (format "Start here: http://localhost:~a/servlets/control.scm\n\n" port))
(display "Press enter to shutdown.\n")
(read-line)
(shutdown)