chg: [application] Added bodyParserMiddleware to parse JSON bodies

pull/59/head
mokaddem 2021-06-17 14:12:17 +02:00
parent 216d04723f
commit 1f8010a6ec
1 changed files with 3 additions and 2 deletions

View File

@ -21,6 +21,7 @@ use Cake\Core\Exception\MissingPluginException;
use Cake\Error\Middleware\ErrorHandlerMiddleware;
use Cake\Http\BaseApplication;
use Cake\Http\MiddlewareQueue;
use Cake\Http\Middleware\BodyParserMiddleware;
use Cake\Routing\Middleware\AssetMiddleware;
use Cake\Routing\Middleware\RoutingMiddleware;
use Authentication\AuthenticationService;
@ -28,7 +29,6 @@ use Authentication\AuthenticationServiceInterface;
use Authentication\AuthenticationServiceProviderInterface;
use Authentication\Middleware\AuthenticationMiddleware;
use Psr\Http\Message\ServerRequestInterface;
/**
* Application setup class.
*
@ -87,7 +87,8 @@ class Application extends BaseApplication implements AuthenticationServiceProvid
// using it's second constructor argument:
// `new RoutingMiddleware($this, '_cake_routes_')`
->add(new RoutingMiddleware($this))
->add(new AuthenticationMiddleware($this));
->add(new AuthenticationMiddleware($this))
->add(new BodyParserMiddleware());
return $middlewareQueue;
}