Skip to content

Commit

Permalink
#6 chore: @RequestMapping을 피하기 위해 filter.RewritePath 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ShinHyeong committed Jan 26, 2023
1 parent e90e133 commit a12c256
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions gateway-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ext {

dependencies {
implementation 'org.springframework.cloud:spring-cloud-starter-gateway'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
Expand Down
23 changes: 19 additions & 4 deletions gateway-server/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
server:
port: 8000

management:
endpoints:
web:
exposure:
include:
- 'gateway'
endpoint:
gateway:
enabled: true

spring:
application:
name: gateway-server
Expand All @@ -9,17 +19,22 @@ spring:
routes:
- id: user-server
predicates:
- Path=/user-server/**
- Path=/user/**
uri: http://localhost:8001
filters:
- RewritePath=/user/(?<path>.*),/$\{path}
- id: feed-server
predicates:
- Path=/feed-server/**
- Path=/feed/**
uri: http://localhost:8002
filters:
- RewritePath=/feed/(?<path>.*),/$\{path}
- id: auth-server
predicates:
- Path=/auth-server/**
- Path=/auth/**
uri: http://localhost:8003

filters:
- RewritePath=/auth/(?<path>.*),/$\{path}
eureka:
client:
register-with-eureka: true
Expand Down

0 comments on commit a12c256

Please sign in to comment.