Comments

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)
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.71.28