Working Gateway
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
}
|
42
src/main/resources/application.yaml
Normal file
42
src/main/resources/application.yaml
Normal 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
|
@ -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() {
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user