You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ To install the Slim-Http library simply run the following command:
35
35
composer require slim/http
36
36
```
37
37
38
-
The `ServerRequest` and `Response` object decorators are automatically detected and applied by the internal factories. If you have installed Slim-Http and wish to turn off automatic object decoration you can use the following statements:
38
+
The `ServerRequest` and `Response` object decorators are automatically detected and applied by the internal factories. If you have installed Slim-Http and wish to turn off automatic object decoration then you can use the following statements:
39
39
```php
40
40
<?php
41
41
@@ -57,6 +57,8 @@ In order for auto-detection to work and enable you to use `AppFactory::create()`
57
57
-[Guzzle/psr7](https://github.com/guzzle/psr7) & [http-interop/http-factory-guzzle](https://github.com/http-interop/http-factory-guzzle) - Install using `composer require guzzlehttp/psr7 http-interop/http-factory-guzzle`
58
58
-[zend-diactoros](https://github.com/zendframework/zend-diactoros) - Install using `composer require zendframework/zend-diactoros`
59
59
60
+
Then create file _public/index.php_.
61
+
60
62
```php
61
63
<?php
62
64
use Psr\Http\Message\ResponseInterface as Response;
@@ -71,7 +73,12 @@ $app = AppFactory::create();
71
73
// Add error middleware
72
74
$app->addErrorMiddleware(true, true, true);
73
75
74
-
// Add route
76
+
// Add routes
77
+
$app->get('/', function (Request $request, Response $response) {
0 commit comments