Skip to content

application.yml의 활용 #5

@danykim57

Description

@danykim57

스프링 프로젝트의 환경설정으로 .yaml 파일이나 .properties를 이용하는 것이 나중에 수정할 때도 편할 것 같습니다.

예시)

spring:
  application:
    name: social_server
  mvc:
    pathmatch:
      matching-strategy: ant_path_matcher
  messages:
    basename: i18n/messages
    encoding: UTF-8
    cache-duration: PT1H
  h2:
    console:
      enabled: true
      path: /h2-console
  datasource:
    driver-class-name: org.h2.Driver
    url: "jdbc:h2:mem:social_server;MODE=MYSQL;DB_CLOSE_DELAY=-1"
    username: sa
    password:
    hikari:
      minimum-idle: 1
      maximum-pool-size: 5
      pool-name: H2_DB
  sql:
    init:
      platform: h2
      schema-locations: classpath:schema-h2.sql
      data-locations: classpath:data-h2.sql
server:
  port: 8080
jwt:
  token:
    header: api_key
    issuer: social_server
    clientSecret: Rel3Bjce2MajBo09qgkNgYaTuzvJe8iwnBFhsDS5
    expirySeconds: 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions