diff --git a/event-planner/api/demo/src/main/java/com/api/demo/controllers/EventController.java b/event-planner/api/demo/src/main/java/com/api/demo/controllers/EventController.java index e4eff020..54d4a4ff 100644 --- a/event-planner/api/demo/src/main/java/com/api/demo/controllers/EventController.java +++ b/event-planner/api/demo/src/main/java/com/api/demo/controllers/EventController.java @@ -10,7 +10,7 @@ @RequestMapping("api/v1/events") public class EventController { - @GetMapping + @GetMapping("/community") public List getAllCommunityEvents() { // Placeholder implementation return List.of(); diff --git a/event-planner/api/demo/src/main/java/com/api/demo/controllers/HomeController.java b/event-planner/api/demo/src/main/java/com/api/demo/controllers/HomeController.java new file mode 100644 index 00000000..c52310ec --- /dev/null +++ b/event-planner/api/demo/src/main/java/com/api/demo/controllers/HomeController.java @@ -0,0 +1,26 @@ +package com.api.demo.controllers; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HomeController { + + @GetMapping("/") + public Map index() { + // Get all available routes in the application + // Build response with welcome message and routes + Map response = new LinkedHashMap<>(); + response.put("message", "🚀 Welcome to The Evynt Event Planning API"); + response.put("version", "v1.0"); + response.put("description", "Event planning application with user management and event creation"); + + return response; + } + +} diff --git a/event-planner/api/demo/src/main/resources/application-local.yml b/event-planner/api/demo/src/main/resources/application-local.yml new file mode 100644 index 00000000..1ed06999 --- /dev/null +++ b/event-planner/api/demo/src/main/resources/application-local.yml @@ -0,0 +1,21 @@ +spring: + h2: + console: + enabled: true + datasource: + url: jdbc:postgresql://localhost:5432/postgres + username: postgres + password: postgres + jpa: + hibernate: + ddl-auto: update + database-platform: org.hibernate.dialect.PostgreSQLDialect + show-sql: true + sql: + init: + # Disable SQL initialization + mode: never + config: + active: + on-profile: local + import: optional:file:.env.properties \ No newline at end of file diff --git a/event-planner/api/demo/src/main/resources/application-prod.yml b/event-planner/api/demo/src/main/resources/application-prod.yml new file mode 100644 index 00000000..b5df8921 --- /dev/null +++ b/event-planner/api/demo/src/main/resources/application-prod.yml @@ -0,0 +1,22 @@ +spring: + profiles: prod + h2: + console: + enabled: true + datasource: + url: ${SPRING_DATASOURCE_URL} + username: ${SPRING_DATASOURCE_USERNAME} + password: ${SPRING_DATASOURCE_PASSWORD} + jpa: + hibernate: + ddl-auto: update + database-platform: org.hibernate.dialect.PostgreSQLDialect + show-sql: true + sql: + init: + # Disable SQL initialization + mode: never + config: + active: + on-profile: prod + import: optional:file:.env.properties diff --git a/event-planner/api/demo/src/main/resources/application.properties b/event-planner/api/demo/src/main/resources/application.properties new file mode 100644 index 00000000..e69de29b diff --git a/event-planner/api/demo/src/main/resources/application.yml b/event-planner/api/demo/src/main/resources/application.yml index 689ae0cd..297894c9 100644 --- a/event-planner/api/demo/src/main/resources/application.yml +++ b/event-planner/api/demo/src/main/resources/application.yml @@ -1,19 +1,5 @@ spring: - h2: - console: - enabled: true - datasource: - url: ${SPRING_DATASOURCE_URL} - username: ${SPRING_DATASOURCE_USERNAME} - password: ${SPRING_DATASOURCE_PASSWORD} - jpa: - hibernate: - ddl-auto: update - database-platform: org.hibernate.dialect.PostgreSQLDialect - show-sql: true - sql: - init: - # Disable SQL initialization - mode: never - config: - import: optional:file:.env.properties + profiles: + active: + - ${SPRING_PROFILES_ACTIVE} + \ No newline at end of file diff --git a/event-planner/api/demo/src/test/resources/application.properties b/event-planner/api/demo/src/test/resources/application.properties new file mode 100644 index 00000000..e69de29b