Microservices based web service that returns the current time in JSON format, pursuant to timezone input from the user.
This project is a microservices-based web service that returns the current time, implemented in Java. Spring Boot is used to create an embedded microservices environment, and Gradle is used as the build tool. This code can be run locally, or deployed to a cloud service such as Amazon Web Services (AWS). Time is returned in JSON format, and returns an informative error in case of incorrect timezone input.
The project requires Java 1.8 and Gradle 4.6 to be installed, and available from the command line. To verify, run the following commands; they should both respond with the current version.
$ java -version
$ gradle -version
To view available Gradle tasks for the Spring Boot application:
$ gradle tasks
To run the standalone Spring Boot application in Gradle:
$ gradle bootRun
To generate the full JAR file, and run manually:
$ gradle build
$ java -jar ./build/libs/sprint-boot-time-web-service.jar
To run the test suite in Gradle, results can be seen in build/reports/tests/test/index.html:
$ gradle test