► |  | Web Server: PLT HTTP Server

1 | Running the Web Server
2 | Writing Servlets
3 | Extending the Web Server
4 | Troubleshooting and Tips
5 | Acknowledgements
| Index

▼ | 1 | Running the Web Server

1.1 | Instant Servlets
1.2 | Simple Single Servlet Servers
1.3 | Command-line Tools
1.4 | Functional

► | 1.1 | Instant Servlets

1.1.1 | Customization API

On this page:

1.1.1`` Customization API
no-web-browser
static-files-path

Version: 4.1.4
top← prev up next →

#### 1.1`` Instant Servlets

#lang web-server/insta

The fastest way to get a servlet running in the Web server is to use the "Insta" language in DrScheme. Enter the following into DrScheme:

#lang web-server/insta
(define (start request)
`(html (head (title "Hello world!"))
(body (p "Hey out there!"))))

And press Run. A Web browser will open up showing your new servlet.

Behind the scenes, DrScheme has used serve/servlet to start a new server that uses your start function as the servlet. You are given the entire web-server/servlet API.

##### 1.1.1`` Customization API

(require web-server/insta/insta)

The following API is provided to customize the server instance:

(no-web-browser) → void

Calling this will instruct DrScheme to not start a Web browser when you press Run.

(static-files-path path) → void
path : path-string?

This instructs the Web server to serve static files, such as stylesheet and images, from path.

top← prev up next →