@@ -45,6 +45,7 @@ dependencies {
|
||||
implementation 'com.github.ben-manes.caffeine:caffeine:3.1.8'
|
||||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0'
|
||||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-api:2.6.0'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
|
||||
testImplementation 'io.projectreactor:reactor-test'
|
||||
compileOnly 'org.projectlombok:lombok'
|
||||
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
||||
|
@@ -0,0 +1,32 @@
|
||||
package dev.mars3142.fhq.config;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.core.models.GroupedOpenApi;
|
||||
import org.springframework.cloud.gateway.route.RouteDefinition;
|
||||
import org.springframework.cloud.gateway.route.RouteDefinitionLocator;
|
||||
import org.springframework.cloud.gateway.route.RouteLocator;
|
||||
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@RequiredArgsConstructor
|
||||
public class OpenAPIConfiguration {
|
||||
|
||||
private final RouteDefinitionLocator locator;
|
||||
|
||||
@Bean
|
||||
public List<GroupedOpenApi> apis() {
|
||||
List<GroupedOpenApi> groups = new ArrayList<>();
|
||||
List<RouteDefinition> definitions = locator.getRouteDefinitions().collectList().block();
|
||||
assert definitions != null;
|
||||
definitions.stream().filter(routeDefinition -> routeDefinition.getId().matches(".*-service"))
|
||||
.forEach(routeDefinition -> {
|
||||
String name = routeDefinition.getId().replaceAll("-service", "");
|
||||
groups.add(GroupedOpenApi.builder().pathsToMatch("/" + name + "/**").group(name).build());
|
||||
});
|
||||
return groups;
|
||||
}
|
||||
}
|
@@ -5,3 +5,10 @@ eureka:
|
||||
client:
|
||||
service-url:
|
||||
defaultZone: http://localhost:8761/eureka
|
||||
|
||||
logging:
|
||||
level:
|
||||
org:
|
||||
springframework:
|
||||
cloud:
|
||||
gateway: TRACE
|
||||
|
@@ -4,8 +4,6 @@ eureka:
|
||||
fetch-registry: true
|
||||
service-url:
|
||||
defaultZone: http://eureka-service.web:8761/eureka
|
||||
instance:
|
||||
instanceId: ${spring.application.name}:${spring.application.instance_id:${random.value}}
|
||||
|
||||
info:
|
||||
application:
|
||||
@@ -36,15 +34,6 @@ sentry:
|
||||
# We recommend adjusting this value in production.
|
||||
tracesSampleRate: 1.0
|
||||
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
path: /swagger-ui.html
|
||||
urls:
|
||||
- name: TimeZone Service
|
||||
url: /aggregate/timezone/v3/api-docs
|
||||
- name: Google Service
|
||||
url: /aggregate/google/v3/api-docs
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: edge-service
|
||||
@@ -60,27 +49,37 @@ spring:
|
||||
backoff:
|
||||
firstBackoff: 50ms
|
||||
maxBackoff: 5000ms
|
||||
discovery:
|
||||
locator:
|
||||
enabled: false
|
||||
routes:
|
||||
- id: edge
|
||||
uri: lb://edge-service
|
||||
predicates:
|
||||
- Path=/v3/api-docs/**
|
||||
filters:
|
||||
- RewritePath=/v3/api-docs/(?<path>.*), /$\{path}/v3/api-docs
|
||||
|
||||
- id: timezone-service
|
||||
uri: lb://timezone-service
|
||||
predicates:
|
||||
- Path=/v1/timezone/**, /health/timezone, /aggregate/timezone/v3/api-docs
|
||||
- Path=/v1/timezone/**, /health/timezone, /timezone/v3/api-docs
|
||||
filters:
|
||||
- RewritePath=/health/timezone, /actuator/health
|
||||
- RewritePath=/aggregate/timezone/v3/api-docs, /v3/api-docs
|
||||
- RewritePath=/timezone/(?<segment>.*), /$\{segment}
|
||||
|
||||
- id: google-service
|
||||
uri: ${GOOGLE_SERVICE_URI:http://google-service.web:8080}
|
||||
predicates:
|
||||
- Path=/v1/account/**, /health/google, /aggregate/google/v3/api-docs
|
||||
- Path=/v1/account/**, /health/google, /google/v3/api-docs
|
||||
filters:
|
||||
- RewritePath=/health/google, /actuator/health
|
||||
- RewritePath=/aggregate/google/v3/api-docs, /v3/api-docs
|
||||
- RewritePath=/google/(?<segment>.*), /$\{segment}
|
||||
|
||||
- id: token-service
|
||||
uri: ${BACKEND_SERVICE_URI:http://backend-service.web:8080}
|
||||
predicates:
|
||||
- Path=/v1/token/**, /health/backend, /aggregate/backend/v3/api-docs
|
||||
- Path=/v1/token/**, /health/backend, /token/v3/api-docs
|
||||
filters:
|
||||
- RewritePath=/health/backend, /actuator/health
|
||||
- RewritePath=/aggregate/backend/v3/api-docs, /v3/api-docs
|
||||
- RewritePath=/token/(?<segment>.*), /$\{segment}
|
||||
|
27
src/main/resources/public/error/404.html
Normal file
27
src/main/resources/public/error/404.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Rive Hello World</title>
|
||||
</head>
|
||||
<body>
|
||||
<div style="text-align: center">
|
||||
<canvas id="canvas" width="400" height="400"></canvas>
|
||||
</div>
|
||||
<script src="https://unpkg.com/@rive-app/canvas@2.20.0"></script>
|
||||
<script>
|
||||
const r = new rive.Rive({
|
||||
src: "https://cdn.rive.app/animations/vehicles.riv",
|
||||
canvas: document.getElementById("canvas"),
|
||||
autoplay: true,
|
||||
// artboard: "Arboard", // Optional. If not supplied the default is selected
|
||||
stateMachines: "bumpy",
|
||||
onLoad: () => {
|
||||
// Ensure the drawing surface matches the canvas size and device pixel ratio
|
||||
r.resizeDrawingSurfaceToCanvas();
|
||||
},
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user