From the course: Java EE: RESTful Service with JAX-RS 2.0

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Define the REST contract

Define the REST contract

From the course: Java EE: RESTful Service with JAX-RS 2.0

Start my 1-month free trial

Define the REST contract

- [Instructor] Let's lay out the endpoint URIs that we will be implementing in the REST API. In the bookshop application, there are going to be two resources: a book resource and an author resource. For both of these resources, we will be defining the appropriate endpoint URIs. These URIs, combined with the appropriate HTTP method, URI variables, or parameters, form the API contract with the client. In order to be clear about the contract's terms, we should specify what they are. First of all, you need to define the application namespace. That's the route to the application. Then, the application path to the route of the API itself. So, for the REST server application, the namespace for the application is rest-server and the application path to the REST API itself is /api. So this, then, makes the route to the REST API rest-server/api. The REST server application will be deployed locally and on port 8081. It's deployed on port 8081 so that the REST application can be deployed on port…

Contents