To view all comments that were created by the previous handler, we have to send a GET request to the comments microservice with theĀ get_request function that we created before and resend the response data to a client:
fn comments(_req: HttpRequest<State>) -> FutureResponse<HttpResponse> {
let fut = get_request("http://127.0.0.1:8003/list")
.map(|data| {
HttpResponse::Ok().body(data)
});
Box::new(fut)
}