Monday, July 17, 2006

Sport and Swazoo released

I've completed the port of Swazoo 1.1.4 and Sport.
I don't have a hosting yet, so if you want them, drop me a request on eMaringolo at gmail dot com.

I have it available in STS Project Export XML format (.pex), and good old .pac packages.

To load the .pac's you must first load Sport, and then Swazoo.
First load Sport in this order:
  • VW Filenames.pac
  • MD5.pac
  • Sport
  • Sport tests

Then load Swazoo in this order:


  • Swazoo-Compatibility.pac
  • Swazoo-Headers.pac
  • Swazoo-Server.pac
  • Swazoo-Resources.pac
  • Swazoo-Examples.pac
  • Swazoo-Tests.pac

Then you can test it evaluating:

site := Site new name: 'swazoo'.
site host: 'localhost' ip: '127.0.0.1' port: 8888.
site addResource: (comp := CompositeResource uriPattern: '/').
comp addResource: (HelloWorldResource uriPattern: 'hello').
SwazooServer singleton addSite: site.
site start.

Then to stop your server do:

site stop

For more information visit Swazoo.org, or Swazoo Sourceforge homepage.

More to follow...

6 Comments:

At 8:02 am, Blogger LogiqueWerks said...

sez: http://www.swazoo.org/documentation.html?id=1013093

Now let we do our own web resource with url '/helloworld.html' to return a web page with ' Hello Word!' :

1. Make new class HelloWorldResource by subclassing Swazoo.Resource,

2. implement (actually override) a method answerTo: aRequest :

| response |
response := Swazoo.HTTPResponse ok.

response entity: '
Hello World!
'.

^response

 
At 8:15 am, Blogger LogiqueWerks said...

answerTo: aRequest

| response |
"Dolphin version"
response := HTTPResponse ok.
response entity: '
Hello World!
'.
^response

 
At 8:16 am, Blogger LogiqueWerks said...

" Dolphin Swazoo test after creating class HelloWorldReource "
| site comp |

site := Site new name: 'swazoo'.
site host: 'localhost' ip: '127.0.0.1' port: 8888.
site addResource: (comp := CompositeResource uriPattern: '/').
comp addResource: (HelloWorldResource uriPattern: 'hello').
SwazooServer singleton addSite: site.
site start.

" to stop "

SwazooServer stopSite: 'swazoo'.
SwazooServer singleton stop.
SwazooServer initSingleton.

 
At 9:05 am, Blogger LogiqueWerks said...

" test in browser with at

http://localhost:8888/hello "

" try variant using

HelloWorldResource uriPattern: 'helloworld.html'

at http://localhost:8888/helloworld.html "

 
At 2:46 pm, Blogger LogiqueWerks said...

" for Seaside this works; you may have to reinit Swazoo (see below )"
| site |
SwazooServer start.

site := Site new name: 'seaside'.
site host: 'localhost' ip: '127.0.0.1' port: 9090.
site addResource: (comp := CompositeResource uriPattern: '/').
comp addResource: (SeasideSwazooResource uriPattern: 'seaside').
SwazooServer singleton addSite: site.
site start.

" test at http://localhost:9090/seaside/counter "

" to stop and reinit "

SwazooServer stopSite: 'seaside'.
SwazooServer singleton stop.
SwazooServer initSingleton.

 
At 3:15 pm, Blogger LogiqueWerks said...

"If you use Swazoo server, you must override in your SwazooResource subclass HelloWorldResource so as to set contentType:"

>>answerTo: aRequest

| response |

response := HTTPResponse ok.
response contentType: 'text/html'.
response entity: '
Hello World!
'.
^response

 

Post a Comment

<< Home

web site analysis