phonebill/kos-mock/src/main/resources/application.yml
hiondal 04b3eba6c6 kos-mock CORS 설정 추가: Spring Boot 모범사례 적용으로 크로스 오리진 요청 지원
- SecurityConfig에 CorsConfigurationSource 빈 추가
- 모든 HTTP 메소드 지원 (GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD)
- 환경변수 기반 Origin 패턴 설정 (개발환경: *, 프로덕션: 구체적 도메인)
- Preflight 요청 캐시 및 노출 헤더 설정
- application.yml에 CORS 설정 블록 추가

🔧 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-11 13:07:13 +09:00

85 lines
1.8 KiB
YAML

spring:
application:
name: kos-mock-service
profiles:
active: ${SPRING_PROFILES_ACTIVE:dev}
datasource:
url: jdbc:h2:file:./data/kos_mock
driver-class-name: org.h2.Driver
username: sa
password: password
sql:
init:
platform: h2
jpa:
database-platform: org.hibernate.dialect.H2Dialect
hibernate:
ddl-auto: update
show-sql: true
properties:
hibernate:
format_sql: true
h2:
console:
enabled: true
path: /h2-console
# Redis 설정
data:
redis:
host: ${REDIS_HOST:localhost}
port: ${REDIS_PORT:6379}
password: ${REDIS_PASSWORD:}
server:
port: ${SERVER_PORT:8084}
# HTTP 헤더 크기 제한 설정
max-http-header-size: 64KB
max-http-request-header-size: 64KB
# Actuator
management:
endpoints:
web:
exposure:
include: health,info,metrics,prometheus
base-path: /actuator
endpoint:
health:
show-details: always
show-components: always
health:
livenessState:
enabled: true
readinessState:
enabled: true
logging:
level:
com.phonebill.kosmock: DEBUG
org.springframework.web: INFO
org.springframework.jdbc.core: DEBUG
org.hibernate.SQL: DEBUG
org.hibernate.type.descriptor.sql: TRACE
com.zaxxer.hikari: DEBUG
pattern:
console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n'
file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n'
file:
name: logs/kos-mock-service.log
# CORS 설정
cors:
allowed-origins: ${CORS_ALLOWED_ORIGINS:*}
# Swagger/OpenAPI
springdoc:
api-docs:
path: /v3/api-docs
swagger-ui:
path: /swagger-ui.html
tags-sorter: alpha
operations-sorter: alpha
show-actuator: true
paths-to-exclude: /actuator/**