function serve405ErrorPage(Response $response) { $response->setStatus(404); return new TextBody('Method not allowed for route.'); }