Skip to content

Commit 834c1f0

Browse files
authored
Merge pull request #52 from clue-labs/http-example
Update HTTP server example for reactphp/http v1.0.0
2 parents f56ab5b + c780656 commit 834c1f0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

theme/homepage.html.twig

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@
4343
```php
4444
$loop = React\EventLoop\Factory::create();
4545

46-
$server = new React\Http\Server(function (Psr\Http\Message\ServerRequestInterface $request) {
47-
return new React\Http\Response(
46+
$server = new React\Http\Server($loop, function (Psr\Http\Message\ServerRequestInterface $request) {
47+
return new React\Http\Message\Response(
4848
200,
49-
array('Content-Type' => 'text/plain'),
49+
array(
50+
'Content-Type' => 'text/plain'
51+
),
5052
"Hello World!\n"
5153
);
5254
});

0 commit comments

Comments
 (0)