fix: update Dockerfile, application properties, and controller mappings for health check and CORS support
All checks were successful
Release and Build Docker Images / release-and-build (push) Successful in 1m38s

This commit is contained in:
almazlar
2026-02-22 14:08:31 +03:00
parent b5dcba1e11
commit 386f5137c6
8 changed files with 37 additions and 20 deletions

View File

@@ -10,8 +10,7 @@ public class WebConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("http://localhost:5173", "http://localhost:3000", "http://localhost:8081",
"http://localhost:80", "https://todo.almazlar.com") // Typical Vite/React/Docker ports
.allowedOrigins("http://localhost:5173", "https://todo.almazlar.com")
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
.allowedHeaders("*")
.allowCredentials(true);

View File

@@ -10,7 +10,7 @@ import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping("/api/version")
@RequestMapping("/version")
public class VersionController {
@Value("${APP_VERSION:dev}")

View File

@@ -1,9 +1,11 @@
# backend/src/main/resources/application.properties
server.port=8082
server.servlet.context-path=/api
spring.application.name=backend
spring.datasource.url=jdbc:postgresql://localhost:5432/tododb
spring.datasource.username=postgres
spring.datasource.password=postgres
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
management.endpoints.web.exposure.include=health,info,metrics
management.endpoint.health.show-details=always