Update June 28, 2009: Added the 4th pattern with default params.
index.php
<?php
require '/path/to/swx.php';
requires ('handlers');
responds_to_requests_like
(
'POST /{handler}',
'/{handler}/[{id}]',
'GET {handler}.example.com:8080 /foobar',
'/.* handler=default,id=1'
);
?>