본문 바로가기
SpringBoot

Spring Boot Project(in★ gram) 01. 환경세팅하기

by 김마리님 2020. 8. 24.

backUp_ui.zip
0.38MB

다음 프로젝트는 Mustache라는 템플릿 엔진을 이용하여 제작한다.

먼저 프로젝트 생성 시 다음과 같이 의존성을 걸어둔다.

 

원래는 NoSQL을 사용하는 것이 좀 더 효율적이지만, 이번에는 MySQL과 JPA를 이용하여 생성한다.

 

먼저 프로그램 환경설정을 한다.

application.properties 파일을 application.yml로 변경하고, 다음과 같이 세팅한다.

server:
  port: 8080
  servlet:
    context-path: /
    encoding:
      charset: UTF-8
      enabled: true
      force: true
    
spring:      
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/insta?serverTimezone=Asia/Seoul&useSSL=false&allowPublicKeyRetrieval=true
    username: insta
    password: bitc5600
    
  jpa:
    open-in-view: true
    hibernate:
      ddl-auto: update
      naming:
        physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
      use-new-id-generator-mappings: false
    show-sql: true

  servlet:
    multipart:
      enabled: true
      max-file-size: 2MB
      
  security:
    user:
      name: cos
      password: 1234   
      
cos:
  secret: --      

file:
  path: C:/src/instaclone/insta/src/main/resources/upload/

 

다음 뷰를 위한 Mustache를 작성한다.

Mustache파일은 압축 파일로 올려두었다. 

 

뷰와 프로퍼티 설정만 끝내면 환경세팅은 끝난다.

반응형