-
Notifications
You must be signed in to change notification settings - Fork 3
Encode the response body to gzip or deflate
Anatoly Nekhay edited this page Jan 7, 2019
·
1 revision
Learn more about the middleware
composer require middlewares/encoder
Open the public/index.php
and add the following code before running the application:
$container->get(Sunrise\Http\Router\RouterInterface::class)
->addMiddleware(new Middlewares\GzipEncoder());
/**
* @Route(
* id="test",
* path="/test",
* methods={"GET"},
* before={
* "Middlewares\GzipEncoder"
* }
* )
*/
class TestController implements MiddlewareInterface
{
// some code
}
Have questions?
Ask your questions in our chat:
Get more features for your application using Awesome PSR-15 Middleware