On this page:
send-url
on-web
Version: 4.1

2.11 Environment

 (require web-server/servlet-env)

The Web Server provides a means of running Scheme servlets from within DrScheme, or any other REPL.

"servlet-env.ss" provides the servlet API from "servlet.ss" as well as the following:

send-url : (parameter/c ([url string?] [separate-window? boolean?] . -> . void))

Should open url. In another window if separate-window? is true. By default this is from net/sendurl.

(on-web servlet-expr)

(on-web port servlet-expr)

The first form expands to (on-web 8000 servlet-expr).

Constructs a small servlet, where the body of the start procedure is servlet-expr, runs the Web Server on port port, and calls send-url with a URL for the constructed servlet. The call blocks until the servlet finishes its computation, i.e. servlet-expr is evaluated, and returns its result. servlet-expr may use the entire Scheme servlet API.