This is a simple Spring Boot based app to demonstrate different ways of connecting to a service or a datastore when deploying to Cloud Foundry.
The simplest approach is to do nothing and let Cloud Foundry’s Java Buildpack handle the details. Cloud Foundry’s Java Buildpack injects a library called the Java Buildpack Auto Reconfiguration into the runtime deployable which reconfigures the service connectivity appropriately.
Spring Boot exposes the VCAP_SERVICES properties which is in the form of a JSON into a more consumable format - as simple environment properties. These properties can be used for configuring the connectivity to the service
Spring Cloud Connector provides the most advanced configuration for enabling connectivity to an external service.
Any of the versions of the application can be brought up by the following steps:
brew install mysql
mysql.server start
mysql -u root
CREATE USER 'springpong'@'localhost' IDENTIFIED BY 'springpong';
CREATE DATABASE pong_matcher_spring_development;
GRANT ALL ON pong_matcher_spring_development.* TO 'springpong'@'localhost';
Try the endpoint available here - http://localhost:8080/courses