Swazoo for GNU Smalltalk is entirely contained in the Swazoo package. This script will start a web server on http://localhost:8888 using the example resource described in the documentation.

PackageLoader fileInPackage: 'Swazoo'.

Swazoo.Resource subclass: MyResource [
answerTo: aRequest [
| response |
response := Swazoo.HTTPResponse ok.
response entity: '<h1>Hello world!</h1>'.
^response
]
]

site := Swazoo.Site new name: 'test'. "name is just for convenience"
site host: 'localhost' ip: '127.0.0.1' port: 8888.

resource := MyResource new uriPattern: 'helloworld.html'.
composite := Swazoo.CompositeResource new uriPattern: '/'.
composite addResource: resource.
site addResource: composite.

Swazoo.SwazooServer singleton addSite: site.
site start.
Processor activeProcess suspend

Swazoo is not included in any released version; you can get it from development snapshots as explained on the GNU Smalltalk web site.





Updated: 6.2.2008