On this page:
2.1 Running Delirium as a top-level application
serve/ delirium
2.2 Running Delirium from within a servlet
make-delirium-controller
run-delirium

2 Running Delirium

Delirium can be started from a top-level application or from within a servlet.

2.1 Running Delirium as a top-level application

(serve/delirium 
  start 
  test 
  [#:run-tests? run-tests? 
  #:run-tests run-tests 
  #:manager manager 
  #:port port 
  #:listen-ip listen-up 
  #:servlet-path servlet-path 
  #:servlet-regexp servlet-regexp 
  #:extra-files-paths extra-files-paths 
  #:mime-types-path mime-types-path 
  #:launch-browser? launch-browser? 
  #:file-not-found-responder file-not-found-responder]) 
  void?
  start : (request? -> response/c)
  test : schemeunit-test?
  run-tests? : boolean? = #t
  run-tests : (schemeunit-test? -> any)
   = test/text-ui/pause-on-fail
  manager : (U manager? #f) = #f
  port : natural? = 8765
  listen-up : (U string? #f) = "127.0.0.1"
  servlet-path : (U string? #f) = "/"
  servlet-regexp : (U string? #f) = #rx""
  extra-files-paths : (listof path?) = null
  mime-types-path : (U path? #f) = #f
  launch-browser? : boolean? = #t
  file-not-found-responder : (U (request? -> response/c) #f)
   = #f
Wrapper for serve/servlet that sets up sensible defaults for Delirium. All relevant arguments are passed straight through except the following:

2.2 Running Delirium from within a servlet

(make-delirium-controller application-controller 
  test 
  [run-tests]) 
  (request? -> response/c)
  application-controller : (request? -> response/c)
  test : schemeunit-test?
  run-tests : procedure? = test/text-ui/pause-on-fail
Wraps application-controller, creating a controller procedure that runs the Delirium test suite if the URL begins with "/test". All other URLs are passed through to the application.

(run-delirium request test [run-tests])  response/c
  request : request?
  test : schemeunit-test?
  run-tests : procedure? = test/text-ui/pause-on-fail
Sends the Delirium test page to the browser and starts running the given test case (which can be a SchemeUnit test suite or test case).

The optional run-tests argument specifies a function to actually run the tests. The default value of run-tests is a version of Schemeunit.plt’s test/text-ui procedure that pauses after each failed test and asks if you wish to continue running tests. This is useful because it allows you to inspect the state of the web page at the point of failure to see what went wrong.