WellRESTed Development Site

To run unit tests, run:

docker-compose run --rm php phpunit

View the code coverage report.

To generate documentation, run:

docker-compose run --rm docs

View documentation.

HTML; return (new Response(200)) ->withHeader('Content-type', 'text/html') ->withBody(new Stream($view)); } } // ----------------------------------------------------------------------------- $server = new Server(); // Add a router to the server to map methods and endpoints to handlers. $router = $server->createRouter(); $router->register("GET", "/", new HomePageHandler()); $server->add($router); $server->add($server->createRouter() ->register('GET, POST', '/cat', function ($rqst, $resp, $next) { $resp = $resp ->withStatus(200) ->withHeader('Content-type', 'text/html') ->withBody(new Stream('Molly')); return $next($rqst, $resp); }) ); $server->add($server->createRouter() ->register('GET', '/cat', function ($rqst, $resp) { $body = (string) $resp->getBody(); return (new Response(200)) ->withHeader('Content-type', 'text/html') ->withBody(new Stream($body . ' Oscar')); }) ); // Read the request from the client, dispatch a handler, and output. $server->respond();