server:
port: 8083
servlet:
context-path: /ui2
session:
cookie:
name: UI2SESSION
security:
basic:
enabled: false
oauth2:
client:
clientId: SampleClientId
clientSecret: secret
accessTokenUri: http://localhost:8081/auth/oauth/token
userAuthorizationUri: http://localhost:8081/auth/oauth/authorize
resource:
userInfoUri: http://localhost:8081/auth/user/me
spring:
thymeleaf:
cache: false
spring:
security:
user:
password: pass
以下是Eureka注册中心的配置:
eureka:
instance:
hostname: localhost
client:
# 以下两项一定要是false,表明自己是服务器,而不需要从其他主机发现服务
registerWithEureka: false
fetchRegistry: false
serviceUrl:
defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
server:
waitTimeInMsWhenSyncEmpty: 0
以下是Eureka客户端应用的配置
eureka:
instance:
statusPageUrlPath: /info
healthCheckUrlPath: /health
client:
healthcheck:
enabled: false
serviceUrl:
defaultZone: http://localhost:8761/eureka/
spring:
application:
name: asset_demo
以下是zuul网关注册到Eureka的配置
eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka/
# 设置服务名称
spring:
application:
name: ZUUL
以下是zuul网关单独使用时的显式配置(默认可以通过Eureka中的服务名进行路由)
zuul:
routes:
resource:
path: /api/**
url: http://localhost:9000
user:
path: /user/**
url: http://localhost:9000/user
以下是springboot中页面
spring.mvc.view.prefix=/pages/ spring.mvc.view.suffix=.html