In this section, we will explore how to expose the RESTful API.
The main unit in Vert.x is the verticle—using this class, we will be able to handle, always in an asynchronous way, requests for our data.
We will create two classes: a helper needed to build the responses associated with specific HTTP verbs, and the verticle class, which exposes the API.
The ActionHelper class is an easy utility class that helps us build responses:
public class ActionHelper { /** * Returns a handler writing the received {@link AsyncResult} to the routing * context and setting the HTTP status to the given status. * * @param context the routing context * @param status the status * @return the handler */ private static <T> Handler<AsyncResult<T>> ...