/spring-boot-api-example

Sample Spring Boot application that exposes a REST API for theme park rides. Accompanies "Building a Spring Boot application in Jenkins" video and article.

Primary LanguageJava

CI

Overview

An example project to demonstrate:

  • how to create a Spring Boot REST API (article | video)
  • how to run Spring Boot in Docker and publish to Docker Hub (article | video)
  • how to deploy the Spring Boot application to AWS with CloudFormation (article | video)

Pre-requisites

  • JDK 8+
  • Docker

Building

Testing

./gradlew test

Building (no tests)

./gradlew assemble

Building (with tests)

./gradlew build

Running in Docker

./gradlew assemble docker dockerRun

Stopping Docker container

./gradlew dockerStop

Deploying to AWS

./gradlew awsCfnMigrateStack awsCfnWaitStackComplete -PsubnetId=<your-subnet-id> -Pregion=<your-region>

Deleting AWS deployment

./gradlew awsCfnDeleteStack awsCfnWaitStackComplete

Using API

  • get all rides - GET /ride to get a list of all the rides
  • get specific ride - GET /ride/${id} to get a specific ride
  • create ride - POST JSON to /ride to create a new ride (see article for full details)

Need further support?

Contact me if you need help at tom@tomgregory.com.