Skip to content

Commit eecf0fe

Browse files
committed
add Spring profiles for dev and prod
1 parent 1e2c318 commit eecf0fe

4 files changed

Lines changed: 13 additions & 7 deletions

File tree

src/main/java/com/taskmanagerapi/dto/TaskResponse.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ public TaskResponse(String id, String name, String description, TaskStatus statu
2121
this.createdAt = createdAt;
2222
}
2323

24+
/*
25+
factory method that converts a Task entity into a TaskResponse DTO.
26+
*/
2427
public static TaskResponse from(Task task) {
2528
return new TaskResponse(
2629
task.getId(),
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
spring.datasource.url=jdbc:h2:file:./data/taskdb;AUTO_SERVER=TRUE
2+
spring.datasource.driver-class-name=org.h2.Driver
3+
spring.datasource.username=sa
4+
spring.datasource.password=
5+
spring.jpa.hibernate.ddl-auto=update
6+
spring.h2.console.enabled=true
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
spring.h2.console.enabled=false
2+
spring.jpa.hibernate.ddl-auto=validate
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
spring.application.name=task-manager-app
2-
3-
spring.datasource.url=jdbc:h2:file:./data/taskdb;AUTO_SERVER=TRUE
4-
spring.datasource.driver-class-name=org.h2.Driver
5-
spring.datasource.username=sa
6-
spring.datasource.password=
7-
spring.jpa.hibernate.ddl-auto=update
8-
spring.h2.console.enabled=true
2+
# active Spring profile:
3+
spring.profiles.active=dev

0 commit comments

Comments
 (0)