/spring-cloud-zuul-gateway

spring-cloud, zuul, spring-cloud-netflix, reverse proxy api gateway, spring-mvc, spring-cloud-eureka, gradle multi project build, kotlin, spring-boot, spring-mvc, webjars locator, react, Fetch API

Primary LanguageKotlin

spring-cloud-zuul-gateway build status

gradle eureka-server:bootRun
gradle order-service:bootRun
gradle product-service:bootRun
gradle api-gateway:bootRun
gradle web-client:bootRun
open http://localhost:8080

edge-clients uses localhost

it knows only api-gateway url: http://localhost:8888

spring.application.name: web-client
zuul:
  routes:
    gateway:
      path: /api/**
      url: http://localhost:8888/api # api-gateway

api-gateway proxying all micro-services routing’s

spring.application.name: api-gateway
zuul:
  prefix: /api
  routes:
    orders:
      path: /orders/**
      serviceId: order-service
    products:
      path: /products/**
      url: http://localhost:8000/**

big picture

                         "/api/orders"  -> by serviceId           order-service
                                                                    |
web-client: "/api/**" -> api-gateway -> eureka-server ------->------*
                                                                    |
                         "/api/products" -> by url                product-service