Creating a basic RESTful application
While the command-line applications do have their place and use, most of today's application development is centered around web, REST, and data services. Let's start with enhancing our BookPub
application by providing it with a web-based API in order to get access to the book catalogs.
We will start where we left off in the previous chapter, so there should already be an application skeleton with the entity objects and a repository service defined and a connection to the database configured.
How to do it...
- The very first thing that we will need to do is add a new dependency to
build.gradle
with thespring-boot-starter-web
starter to get us all the necessary libraries for web-based functionality. The following code snippet is what it will look like:
dependencies { compile("org.springframework.boot:spring-boot-starter-data-jpa") compile("org.springframework.boot:spring-boot-starter-jdbc") compile("org.springframework.boot:spring-boot-starter-web"...