Skip to content

Commit

Permalink
4차 세미나 보강 #10
Browse files Browse the repository at this point in the history
  • Loading branch information
PgmJun authored May 12, 2023
2 parents 79b3d3e + 9abf038 commit fc60188
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package sopt.org.fourthSeminar.controller;


import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;

@RestController
@RequiredArgsConstructor
public class ServerProfileController {

private final Environment env;

@GetMapping("profile")
public String getProfile() {
return Arrays.stream(env.getActiveProfiles())
.findFirst()
.orElse("");
}
}
38 changes: 37 additions & 1 deletion fourthSeminar/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
spring:
profiles:
active: set1

# set1
---
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/sopt_32?useSSL=true&useUnicode=true&serverTimezone=Asia/Seoul
username: root
password: 1234

jpa:
show-sql: true
hibernate:
ddl-auto: create
properties:
hibernate:
format_sql: true

logging:
level:
org:
hibernate:
type:
descriptor:
sql: trace
server:
port: 8080


# set2
---
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
Expand All @@ -19,4 +53,6 @@ logging:
hibernate:
type:
descriptor:
sql: trace
sql: trace
server:
port: 8082

0 comments on commit fc60188

Please sign in to comment.