Hello

20. JWT위한 yml파일 세팅

by 볼빵빵오춘기

yml 설정(feat. properties파일 설정)

영상에서는 yml 설정하였으나 나는 기존에 쓰던 properties파일을 하여 yml로 하지않고 properties파일로 설정하였다. 

#h2 console
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
#h2 db
spring.datasource.url=jdbc:h2:tcp://localhost/~/test;DATABASE_TO_UPPER=TURE
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect
#hibernate
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.show_sql=true
spring.jpa.hibernate.ddl-auto=create
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

 

RestApiController.java

controller 패키지 생성 후 RestApiController.java 생성 및 코드 추가한다.

@RestController
public class RestApiController {
@GetMapping("/home")
public String home(){
return "<h1>home</h1>";
}
}
블로그의 프로필 사진

블로그의 정보

Hello 춘기's world

볼빵빵오춘기

활동하기