diff --git a/theme/homepage.html.twig b/theme/homepage.html.twig index 3abdbe5b..7faedfa3 100644 --- a/theme/homepage.html.twig +++ b/theme/homepage.html.twig @@ -41,9 +41,7 @@
{% markdown %} ```php -$loop = React\EventLoop\Factory::create(); - -$server = new React\Http\Server($loop, function (Psr\Http\Message\ServerRequestInterface $request) { +$server = new React\Http\Server(function (Psr\Http\Message\ServerRequestInterface $request) { return new React\Http\Message\Response( 200, array( @@ -53,15 +51,13 @@ $server = new React\Http\Server($loop, function (Psr\Http\Message\ServerRequestI ); }); -$socket = new React\Socket\Server(8080, $loop); +$socket = new React\Socket\Server('127.0.0.1:8080'); $server->listen($socket); -echo "Server running at http://127.0.0.1:8080\n"; - -$loop->run(); +echo "Server running at http://127.0.0.1:8080" . PHP_EOL; ``` {% endmarkdown %} -

This simple web server written in ReactPHP responds with "Hello World" for every request.

+

This simple web server written in ReactPHP responds with "Hello World!" for every request.