Slide 56
Slide 56 text
RPCごとのルーティングを追加
Amp HTTP Server⽤のルータを追加
各RPCは
POST /{
サービス名}/{
メソッド名}
に対応
$router = new Amp\Http\Server\Router();
$chatService = new ChatService(
new Rx\Subject\Subject(),
$logger
);
$router->addRoute(
'POST',
'/GrpcWebChat.Chat/SendMessage',
new SendMessageRequestHandler($chatService, $requestBodyDeserializer, $responseFactory)
);
$router->addRoute(
'POST',
'/GrpcWebChat.Chat/Subscribe',
new SubscribeRequestHandler($chatService, $responseFactory)
);
Nextat Inc. 56