Skip to content

spring-cloud-services-samples/cook

Config Server sample

CircleCI

Cook is an example application demonstrating the use of Config Server for Tanzu Application Service. (For information on the Config Server product in Tanzu Application Service, please see the documentation.)

The main branch is using spring-boot 3.x and spring-cloud 2023.x. Check spring-boot-2.7, spring-boot-2.6, spring-boot-2.5 and spring-boot-2.4 branches for older versions.

Building and Deploying

  1. If using Maven, run:

    $ mvn package

    If using Gradle, run ./gradlew build (macOS, Linux) or gradlew.bat build (Windows).

    $ ./gradlew build
  2. Run the deployment script (scripts/deploy.sh on Linux or maxOS, scripts/deploy.bat on Windows), giving it the path to the application archive. (This will be something like target/cook-0.0.1-SNAPSHOT.jar if you used Maven or build/libs/cook-0.0.1-SNAPSHOT.jar if you used Gradle.)

    $ ./scripts/deploy.sh target/cook-0.0.1-SNAPSHOT.jar

    The script will create a Config Server service instance, push the application, and bind the Config Server service instance to the application.

    Note

    By default, the Config Server client dependency will cause all application endpoints to be secured by HTTP Basic authentication. For more information or if you wish to deactivate this, see the documentation. (HTTP Basic authentication is disabled in this sample application.)

Trying It Out

  1. Visit [ROUTE]/restaurant, where [ROUTE] is the route bound to the application. The “special” of the day will be taken from the configuration repository and the value of cook.special.

    link:docs/images/special-of-the-day.png

For more information about the Config Server and its use in a client application, see the Config Server documentation.

About

Sample application demonstrating use of Config Server for Tanzu

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published