Working Gateway

This commit is contained in:
2022-04-23 23:14:28 +02:00
commit c32d93242d
12 changed files with 774 additions and 0 deletions

View File

@ -0,0 +1,13 @@
package at.dergeorg.todogateway;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class TodoGatewayApplication {
public static void main(String[] args) {
SpringApplication.run(TodoGatewayApplication.class, args);
}
}

View File

@ -0,0 +1,42 @@
server:
port: ${GATEWAYPORT:9997}
spring:
application:
name: todo-gateway
cloud:
gateway:
routes:
- id: todo-service
uri: lb://TODO-SERVICE
predicates:
- Path=/todo-service/**
filters:
- RewritePath=/todo-service(?<segment>.*), /api/$\{segment}
- id: todo-config
uri: lb://TODO-CONFIG
predicates:
- Path=/todo-config/**
filters:
- RewritePath=/todo-config(?<segment>.*), /$\{segment}
globalcors:
cors-configurations:
"[/**]":
allowedOrigins: "*"
allowedHeaders: "*"
allowedMethods: "*"
eureka:
client:
register-with-eureka: false
registry-fetch-interval-seconds: 5
# fetch-registry: true
service-url:
defaultZone: http://${HOSTNAME:localhost}:${EUREKAPORT:8761}/eureka
management:
endpoints:
web:
exposure:
include: gateway

View File

@ -0,0 +1,13 @@
package at.dergeorg.todogateway;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class TodoGatewayApplicationTests {
@Test
void contextLoads() {
}
}