basic-spring to master #5
2
dummy/src/main/resources/application-docker.yml
Normal file
2
dummy/src/main/resources/application-docker.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
app:
|
||||
eureka-server: eureka
|
|
@ -1 +0,0 @@
|
|||
spring.application.name=dummy
|
36
dummy/src/main/resources/application.yml
Normal file
36
dummy/src/main/resources/application.yml
Normal file
|
@ -0,0 +1,36 @@
|
|||
app:
|
||||
eureka-server: localhost
|
||||
|
||||
server:
|
||||
port: 0
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: dummy
|
||||
|
||||
# TODO remove after testing
|
||||
security:
|
||||
user:
|
||||
name: admin
|
||||
password: admin
|
||||
|
||||
springdoc:
|
||||
enable-native-support: true
|
||||
api-docs:
|
||||
enabled: true
|
||||
path: /api/v1/dummy/v3/api-docs
|
||||
swagger-ui:
|
||||
path: /api/v1/dummy/swagger-ui.html
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: "*"
|
||||
|
||||
eureka:
|
||||
client:
|
||||
service-url:
|
||||
defaultZone: http://localhost:8761/eureka
|
||||
# Will only work when docker is used
|
||||
# defaultZone: http://${app.eureka-server}:8761/eureka
|
|
@ -1,10 +0,0 @@
|
|||
spring.application.name=eureka
|
||||
|
||||
server.port=8761
|
||||
|
||||
spring.security.user.name=admin
|
||||
spring.security.user.password=admin
|
||||
|
||||
eureka.instance.hostname=localhost
|
||||
eureka.client.register-with-eureka=false
|
||||
eureka.client.fetch-registry=false
|
18
eureka/src/main/resources/application.yml
Normal file
18
eureka/src/main/resources/application.yml
Normal file
|
@ -0,0 +1,18 @@
|
|||
server:
|
||||
port: 8761
|
||||
|
||||
eureka:
|
||||
client:
|
||||
register-with-eureka: false
|
||||
fetch-registry: false
|
||||
instance:
|
||||
hostname: localhost
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: eureka
|
||||
security:
|
||||
# TODO remove after testing
|
||||
user:
|
||||
name: admin
|
||||
password: admin
|
2
gateway/src/main/resources/application-docker.yml
Normal file
2
gateway/src/main/resources/application-docker.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
app:
|
||||
eureka-server: eureka
|
|
@ -1,25 +0,0 @@
|
|||
spring.application.name=gateway
|
||||
app.eureka-server=localhost
|
||||
|
||||
eureka.client.service-url.defaultZone=http://localhost:8761/eureka
|
||||
server.port=8181
|
||||
server.servlet.context-path=/
|
||||
|
||||
spring.cloud.discovery.enabled=true
|
||||
|
||||
# TODO change these back to lambda's stuffs
|
||||
spring.cloud.gateway.mvc.routes[0].id=discovery-server
|
||||
spring.cloud.gateway.mvc.routes[0].uri=http://${app.eureka-server}:8761
|
||||
spring.cloud.gateway.mvc.routes[0].predicates[0]=Path=/eureka/web
|
||||
spring.cloud.gateway.mvc.routes[0].filters[0]=SetPath=/
|
||||
|
||||
springdoc.enable-javadoc=true
|
||||
springdoc.api-docs.enabled=true
|
||||
springdoc.api-docs.groups.enabled=true
|
||||
springdoc.swagger-ui.enabled=true
|
||||
springdoc.swagger-ui.path=/swagger-ui.html
|
||||
springdoc.swagger-ui.config-url=/v3/api-docs/swagger-config
|
||||
|
||||
|
||||
springdoc.swagger-ui.urls[0].name=Api Gateway APIs
|
||||
springdoc.swagger-ui.urls[0].url=/v3/api-docs
|
81
gateway/src/main/resources/application.yml
Normal file
81
gateway/src/main/resources/application.yml
Normal file
|
@ -0,0 +1,81 @@
|
|||
server:
|
||||
port: 8181
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: gateway
|
||||
|
||||
cloud:
|
||||
gateway:
|
||||
discovery:
|
||||
locator:
|
||||
enabled: true
|
||||
routes:
|
||||
# eureka service routing
|
||||
- id: eureka
|
||||
# Will only work when docker is used
|
||||
# uri: http://${app.eureka-server}:8761
|
||||
uri: http://localhost:8761
|
||||
predicates:
|
||||
- Path=/eureka/web
|
||||
filters:
|
||||
- SetPath=/
|
||||
- id: eureka-static
|
||||
# Will only work when docker is used
|
||||
# uri: http://${app.eureka-server}:8761
|
||||
uri: http://localhost:8761
|
||||
predicates:
|
||||
- Path=/eureka/**
|
||||
# dummy service routing
|
||||
# TODO smth is wrong with this
|
||||
- id: dummy
|
||||
uri: lb://dummy
|
||||
predicates:
|
||||
- Path=/api/v1/dummy/**
|
||||
filters:
|
||||
- AddResponseHeader=X-Powered-By, LearningPulse Gateway Service
|
||||
security:
|
||||
user:
|
||||
name: admin
|
||||
password: admin
|
||||
|
||||
|
||||
# Keycloak configuration for the future
|
||||
# security:
|
||||
# oauth2:
|
||||
# resourceserver:
|
||||
# jwt:
|
||||
# issuer-uri: ${KEYCLOAK_URL}/realms/LearningPulse
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: "*"
|
||||
endpoint:
|
||||
health:
|
||||
show-details: always
|
||||
gateway:
|
||||
enabled: true
|
||||
|
||||
springdoc:
|
||||
enable-native-support: true
|
||||
api-docs:
|
||||
enabled: true
|
||||
groups:
|
||||
enabled: true
|
||||
swagger-ui:
|
||||
path: /swagger-ui.html
|
||||
config-url: /v3/api-docs/swagger-config
|
||||
urls:
|
||||
- name: Gateway API
|
||||
url: /v3/api-docs
|
||||
# TODO not working rn
|
||||
- name: Dummy Service API
|
||||
url: /api/v1/dummy/v3/api-docs
|
||||
|
||||
eureka:
|
||||
client:
|
||||
service-url:
|
||||
defaultZone: http://localhost:8761/eureka
|
||||
# Will only work when docker is used
|
||||
# defaultZone: http://${app.eureka-server}:8761/eureka
|
Reference in a new issue