Simple set of microservices for displaying a product detail page on an e-commerce site.
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
Run the following command to build the demo components:
./gradlew clean build
Run the following command to build the demo components as Docker containers:
./gradlew clean buildImage
-
Ensure that you have a local Consul cluster running.
-
In a new terminal, run the following command to start the product service:
./gradlew :product-service:bootRunLocal
-
In a new terminal, run the following command to start the inventory service:
./gradlew :inventory-service:bootRunLocal
-
In a new terminal, run the following command to start the store application:
./gradlew :store-app:bootRunLocal
-
In a web browser, open the url http://localhost:8082/product/001 to view the product in the store application.
-
Ensure that you have a local Consul cluster running.
-
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
-
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
-
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
-
In a web browser, open the url http://localhost:8082/product/001 to view the product in the store application.
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.