Skip to content

Commit

Permalink
Update readme to add middleware to web group
Browse files Browse the repository at this point in the history
Middleware should be in the web group and not global as assets do not normally get pushed from API's and most REST clients do not support HTTP2 Push in the first place.
  • Loading branch information
tankerkiller125 authored Nov 1, 2016
1 parent c4efac5 commit 4e1ea8b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@ You can install the package via composer:
$ composer require jacobbennett/laravel-http2serverpush
```

Next you must add the `\JacobBennett\Http2ServerPush\Middleware\AddHttp2ServerPush`-middleware to the kernel.
Next you must add the `\JacobBennett\Http2ServerPush\Middleware\AddHttp2ServerPush`-middleware to the kernel. Adding it to the web group is recommeneded as API's do not have assets to push.
```php
// app/Http/Kernel.php

...
protected $middleware = [
protected $middlewareGroups = [
'web' => [
...
\JacobBennett\Http2ServerPush\Middleware\AddHttp2ServerPush::class,
...
],
...
\JacobBennett\Http2ServerPush\Middleware\AddHttp2ServerPush::class,
];
```

Expand Down

0 comments on commit 4e1ea8b

Please sign in to comment.