This application requires Gradle and Java 11 to be installed on the host machine. If you're installing Java for the first time, please ensure that all PATH variables are set appropriately before continuing.
./gradlew.bat build bootRun
./gradlew build bootRun
The test case task will execute as part of the build task but they can also be run seperately through the following command:
./gradlew.bat test
./gradlew test
The application exposes the following endpoints:
-
GET http://localhost:5000/rates - returns all loaded rates
-
PUT http://localhost:5000/rates - takes a body object of rates and reinitialized local storage with the new values
-
GET http://localhost:5000/price?start=2015-07-01T07:00:00-05:00&end=2015-07-01T12:00:00-05:00 - takes two URL parametes and returns the calculated price, if any. If there is no valid price, it will return unavailable.
Note: When performing a GET against the price endpoint, please ensure that all values are HTML encoded.
A file named rates.json in the resources/static folder contains the initial data loaded into the repository upon application initialization. Updates to this file will be reflected upon restarting the application.
This application utilizes the Spring framework with SpringBoot and SpringData providing core functionality. Upon running the gradle commands above, all required dependencies will be downloaded.
For further reference, please consider the following sections:
- Official Gradle documentation
- Spring Boot Gradle Plugin Reference Guide
- Create an OCI image
- Spring Web
The following guides illustrate how to use some features concretely:
- Building a RESTful Web Service
- Serving Web Content with Spring MVC
- Building REST services with Spring
These additional references should also help you: