Code Monkey home page Code Monkey logo

httpgateway-demo's Introduction

httpgateway-demo

Simple set of microservices for displaying a product detail page on an e-commerce site.

Prerequisites

This demo requires a running Consul instance for service discovery.

Once installed you can start a local development Consul by running the following command:

consul agent -dev

Building the Demo

Run the following command to build the demo components:

./gradlew clean build

Building the Demo for Docker

Run the following command to build the demo components as Docker containers:

./gradlew clean buildImage

Running the Demo

  1. Ensure that you have a local Consul cluster running.

  2. In a new terminal, run the following command to start the product service:

     ./gradlew :product-service:bootRunLocal
    
  3. In a new terminal, run the following command to start the inventory service:

     ./gradlew :inventory-service:bootRunLocal
    
  4. In a new terminal, run the following command to start the store application:

     ./gradlew :store-app:bootRunLocal
    
  5. In a web browser, open the url http://localhost:8082/product/001 to view the product in the store application.

    pdp-screenshot.png

Running the Demo in Docker

  1. Ensure that you have a local Consul cluster running.

  2. In a new terminal, run the following command to start the product service:

     docker run -e SPRING_PROFILES_ACTIVE='localdocker' -p 8081:8081 netifi/httpgateway-demo-product-service
    
  3. In a new terminal, run the following command to start the inventory service:

     docker run -e SPRING_PROFILES_ACTIVE='localdocker' -p 8080:8080 netifi/httpgateway-demo-inventory-service
    
  4. In a new terminal, run the following command to start the store application:

     docker run -e SPRING_PROFILES_ACTIVE='localdocker' -p 8082:8082 netifi/httpgateway-demo-store-app
    
  5. In a web browser, open the url http://localhost:8082/product/001 to view the product in the store application.

License

Copyright 2019, Netifi Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

httpgateway-demo's People

Contributors

gregwhitaker avatar

Watchers

 avatar  avatar

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.