-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
From @basz on March 14, 2017 20:34
suggested by @oqq
not a bad idea... I now have one strategy that actually handles two kind of responses...
$responseStrategy = $this->responseStrategyFactory->createStrategyFromRequest($request);
return $responseStrategy->fromPromise(
$this->queryBus->dispatch($query)
);
router config
[
'name' => 'query::status-pong',
'path' => '/status/pong',
'middleware' => [
QueryMiddleware::class,
],
'allowed_methods' => ['POST'],
'options' => [
'values' => [
QueryMiddleware::NAME_ATTRIBUTE => Status\QueryName::pong,
QueryMiddleware::PROMISE_TO_RESPONSE_STRATEGY => A/JsonResponse::class,
],
],
],
Copied from original issue: prooph/psr7-middleware#19
Metadata
Metadata
Assignees
Labels
No labels