Home > AI > Backend > SpringBoot > spring-cloud-starter-gateway >

Spring Cloud Gateway Example 2

You can also config the endpoint at application.yml

For example, After predicate

spring:
  cloud:
    gateway:
      routes:
        - id: after_route
          uri: https://jobyme88.com
          predicates:
            - After=2022-01-20T17:42:47.789-07:00[America/Denver];

When call

curl http://localhost:8080/after_router

You will see the response of https://jobyme88.com/after_router if the request is made after the speficied date. Otherwise you will get error of Whitelabel Error Page

Leave a Reply