Giter Club home page Giter Club logo

cook's Introduction

Config Server sample

Cook is an example application demonstrating the use of Config Server for Pivotal Cloud Foundry. (For information on the Config Server product, please see the documentation.)

Building and Deploying

  1. If using Maven, run:

    $ mvn package

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

    $ ./gradlew build
  2. Run the deployment script (scripts/deploy.sh on Linux or OS X, 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.

  3. When the script has finished, set the TRUST_CERTS environment variable to the API endpoint of your Elastic Runtime instance (as in api.example.com), then run cf restage cook to restage the application so that that change will take effect. Setting TRUST_CERTS causes Spring Cloud Services to add the the SSL certificate at the specfied API endpoint to the JVM’s truststore, so that the client application can communicate with a Config Server service instance even if your Elastic Runtime instance is using a self-signed SSL certificate (see the Config Server documentation).

    $ cf set-env cook TRUST_CERTS api.wise.com
    Setting env variable 'TRUST_CERTS' to 'api.wise.com' for app cook in org myorg / space development as user...
    OK
    TIP: Use 'cf restage' to ensure your env variable changes take effect
    $ cf restage cook
    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 disable 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.