Replace PathResourceResolver SPA fallback with SpaController that injects OG/Twitter meta-tags into cached index.html template. Event pages get event-specific tags (title, date, location), all other pages get generic fete branding. Includes og-image.png brand asset and forward-headers-strategy for proxy support. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
25 lines
848 B
Java
25 lines
848 B
Java
package de.fete.config;
|
|
|
|
import java.time.Clock;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
/** Configures API path prefix. Static resources served by default Spring Boot handler. */
|
|
@Configuration
|
|
public class WebConfig implements WebMvcConfigurer {
|
|
|
|
/** Provides a system clock bean for time-dependent services. */
|
|
@Bean
|
|
Clock clock() {
|
|
return Clock.systemDefaultZone();
|
|
}
|
|
|
|
@Override
|
|
public void configurePathMatch(PathMatchConfigurer configurer) {
|
|
configurer.addPathPrefix("/api", c -> c.isAnnotationPresent(RestController.class));
|
|
}
|
|
}
|