Spring Data REST - Starbucks example
This sample app exposes 10843 Starbucks coffee shops via a RESTful API that allows to access the stores in a hypermedia based way and exposes a resource to execute geo-location search for coffee shops.
- Install MongoDB (http://www.mongodb.org/downloads, unzip, run
mkdir data, run
- Build and run the app (
- Access the root resource (
curl http://localhost:8080/api) and traverse hyperlinks.
- Or access the location search directly (e.g.
The application provides a custom web UI using the exposed REST API to display the search result on a Google Map. Point you browser to
http://localhost:8080. The UI is rendered using Thymeleaf, driven by the
<div id="map" data-uri="…" />).
The API itself can be discovered using the HAL browser pulled in through the corresponding Spring Data REST module (
spring-data-rest-hal-browser). It's exposed at the API root at
- Spring Data REST & Spring Data MongoDB
- Spring Batch (to read the CSV file containing the store data and pipe it into MongoDB)
- Spring Boot