chickadee » schematra » schematra-start

(schematra-start #!key (port 8080) (bind-address #f) (log-output (current-output-port)) (log-level 'info) (log-format 'text))procedure

Start the web server. Logging is handled by the logger egg.

  • port: the port to listen to, defaults to 8080
  • bind-address: whether or not to bind to a specific address. If #f then it binds to 0.0.0.0
  • log-output: output port for logs. Defaults to (current-output-port).
  • log-level: minimum log level — 'debug, 'info, 'warn, or 'error. Defaults to 'info.
  • log-format: output format — 'text or 'json. Defaults to 'text.

When log-format is 'json, access logs are emitted as structured logger entries with message "request" and fields such as remote_addr, method, uri, response_code, referer, and user_agent. Text logs keep the default Spiffy-style access log line.

When SCHEMATRA_ENV is set to "development", the server starts on a separate thread.