January 2019
Intermediate to advanced
520 pages
14h 32m
English
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)}
Read now
Unlock full access