Files
cameleer-deploy-demo/src/main/java/com/cameleer/deploy/config/SpaConfig.java
hsiegeln 5bbec1e52a
Some checks failed
CI / build (push) Failing after 20s
CI / docker (push) Has been skipped
CI / deploy (push) Has been skipped
feat: CI/CD workflow, Dockerfile, and K8s deployment
- Multi-stage Dockerfile (Maven + Node build, JRE runtime)
- Gitea Actions CI: build → docker → deploy
- K8s manifests: Deployment, Service (NodePort 30082), Ingress
- ServiceAccount + RBAC for kubectl access from pod
- Docker socket mount for image builds
- Ingress at deploy.cameleer.siegeln.net
- SPA config for serving frontend from Spring Boot
- cameleer-demo namespace for deployed apps

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 09:44:49 +02:00

26 lines
975 B
Java

package com.cameleer.deploy.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* Serves the SPA frontend. All non-API, non-static paths forward to index.html
* so that client-side routing works.
*/
@Configuration
public class SpaConfig implements WebMvcConfigurer {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
// Forward non-API paths to index.html for SPA routing
registry.addViewController("/").setViewName("forward:/index.html");
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**")
.addResourceLocations("classpath:/static/", "file:static/");
}
}